#include "OLED.h"
#include <Wire.h>
#include <EEPROM.h>
#include "Flash.h"
#include "RFID.h"
int times_test = 0;
// MAC 加密之后 0xffafq3213
// int64_t key = 0xd4e2b3188534; // 算法加密 0xf132131
// int64_t key = 0xa4e2b3188534;
// uint64_t key = 0x5ce3b3188534;
uint64_t key = 0xa4e2b3188534;
uint64_t mac = ESP.getEfuseMac();
int64_t ID1(void)
{
    int64_t value = mac - key + 1;
    printf("%llx\n%llx\n%lld\n",mac,key,value);
    return value;
}
int64_t ID0(void)
{
    int64_t value = mac - key;
    return value;
}

// U8G2_SSD1306_128X64_NONAME_F_SW_I2C u8g2(U8G2_R0, OLED_SCL, OLED_SDA, U8X8_PIN_NONE); // OLED初始化
U8G2_SSD1306_128X64_NONAME_F_HW_I2C u8g2(U8G2_R0, U8X8_PIN_NONE, OLED_SCL, OLED_SDA); // OLED初始化
void (*resetFunc)(void) = 0;                                                          // 系统重启函数
// 扫码模式
uint8_t scan_mode = 0;      // 0 红外 1 RFID 2 CAM
uint8_t key_value = 0;      // 按键值
uint8_t key_value_last = 0; // 按键值

uint32_t key_time = 0; // 按键时间

//**************************************OLED模块**************************************************//
int MCU_OLED = 39; // OLED 电源使能 高电平有效(输出)
int OLED_SCL = 9;
int OLED_SDA = 10;
//**************************************蜂鸣器**************************************************//
int MCU_BEEP = 21;
//**************************************OLED模块**************************************************//

//****************************************按键&&电量********************************************************//
int BAT_ADC = 1;   // 电池电压采样(ADC)
int KEY_ADC = 2;   // 多功能按键(ADC)
int TRIG_KEY = 42; // 扫描触发 下拉输入 高电平触发 (外部中断)
int USB_D_F = 19;  // USB 数据－
int USB_D_Z = 20;  // USB 数据＋
//****************************************按键&&电量********************************************************//

//****************************************菜单**************************************************//
xRuning_Menu Runing_Menu;
xMenu_Item Main_Menu;
xMenu_Item OLED_Menu;
xMenu_Item IR_Menu;
xMenu_Item RFID_Menu;
xMenu_Item CAM_Menu;
xMenu_Item SYS_Menu;
void Main_Menu_Title(void);
void Main_Menu_Function(void);

void OLED_Menu_Title(void);
void OLED_Menu_Function(void);

void IR_Menu_Title(void);
void IR_Menu_Function(void);

void RFID_Menu_Title(void);
void RFID_Menu_Function(void);

void CAM_Menu_Title(void);
void CAM_Menu_Function(void);

void SYS_Menu_Title(void);
void SYS_Menu_Function(void);
//****************************************菜单**************************************************//
uint8_t IR_Flag = 0;
uint8_t RFID_Flag = 0;
uint8_t CAM_Flag = 0;
uint8_t GPS_Flag = 0;

uint8_t OLED_Light = 255; // 屏幕亮度
int OLED_XP = 0;          // 自动息屏
uint8_t OLED_Seconds = 5; // 息屏时间

int IR_Location_light = 0; // 激光模式
int IR_Coiled = 0;         // IR是否连续发送
int IR_C_time = 0;

int RFID_Location_light = 0;
int RFID_Power = 26; // RFID发送功率
int RFID_Coiled = 0; // RFID是否连续发送
int RFID_C_time = 0;

int CAM_Location_light = 0; // 扫描定位灯 -1 关闭 0 扫描时开启 // 1常亮
int CAM_Fill_light = 0;     // 扫描补光灯 -1 关闭 0 扫描时开启 // 1常亮
int CAM_Coiled = 0;         // RFID是否连续发送
int CAM_C_time = 0;

int8_t OLED_Line = 0;
int8_t OLED_Line_last = 0;
int8_t select_staute = 0;
int8_t top_bottom = 0;

short x, x_trg; // x当前位置数值,x_trg 目标坐标值
short y = 18, y_trg = 18;

short text_x, text_x_trg; // x当前位置数值,x_trg 目标坐标值
short text_y, text_y_trg;

short frame_len, frame_len_trg; // 框框的x
short frame_y, frame_y_trg;     // 框框的y

int ui_select = 0;
int ui_select_last = 0;
int menu_select = 0;
int menu_flag = 0;

char scan_data_1[256];
char scan_data_2[256];

int power_v_lb[600];
int power_v_num = 0;

int data = 0;
//****************************************显示坐标**************************************************//

uint8_t Bluetooth_X = 0; // Bluetooth图标X
uint8_t Bluetooth_Y = 2; // Bluetooth图标Y

uint8_t Mode_X = 30; // 模式图标X
uint8_t Mode_Y = 14; // 模式图标Y

uint8_t GPS_X = 70; // GPS图标X
uint8_t GPS_Y = 2;  // GPS图标Y

uint8_t barrier_X = 100; // 电池图标X
uint8_t barrier_Y = 2;   // 电池图标Y

uint8_t line_x = 120;
uint8_t line_y[3] = {30, 45, 60};

int8_t frame_line = 0; // 选框行
int8_t text_line = 0;  // 选框行
//****************************************显示坐标**************************************************//

//******************************************图标****************************************************//
// width: 122, height: 32  开机动画
const unsigned char start_ui[] U8X8_PROGMEM = {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x70, 0x00, 0x00, 0x00, 0x30, 0x00, 0x18, 0x00, 0x00, 0x21, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x01, 0x00, 0x43, 0x70, 0x00, 0x38, 0x00, 0x00, 0xe7, 0x00, 0x18, 0x00, 0x07, 0x00, 0x00, 0xe0, 0x01, 0x00, 0xc7, 0x71, 0x00, 0x38, 0x00, 0x00, 0xe7, 0x00, 0xf8, 0xff, 0x07, 0x00, 0x00, 0xc0, 0x01, 0x00, 0xc3, 0x71, 0x00, 0x38, 0x00, 0x00, 0xe7, 0x00, 0xf8, 0xff, 0x07, 0x00, 0x00, 0x80, 0x01, 0x00, 0xc3, 0x71, 0x70, 0x38, 0x1c, 0x00, 0xe7, 0x00, 0x38, 0x00, 0x07, 0x00, 0x00, 0xfe, 0x61, 0x00, 0xc3, 0x71, 0xf0, 0xff, 0x1f, 0x04, 0xe7, 0x18, 0xf8, 0xff, 0x07, 0x00, 0x00, 0xfe, 0xf1, 0x00, 0xc3, 0x71, 0xf0, 0xff, 0x1f, 0x0c, 0xe7, 0x38, 0xf8, 0xff, 0x07, 0x00, 0x00, 0xc0, 0xf1, 0x60, 0xcf, 0x73, 0x70, 0x38, 0x1c, 0x1c, 0xe7, 0x3c, 0x38, 0x00, 0x07, 0x00, 0x00, 0xc8, 0x7b, 0xe0, 0xdf, 0x77, 0x70, 0x38, 0x1c, 0x38, 0xe7, 0x1c, 0x38, 0x00, 0x0c, 0x00, 0xe0, 0xff, 0x3f, 0xe0, 0xfb, 0x7f, 0xf0, 0xff, 0x1f, 0x38, 0xe7, 0x1e, 0xf8, 0xff, 0x1f, 0x00, 0xe0, 0xdf, 0x0f, 0xf0, 0xfb, 0x7f, 0xf0, 0xff, 0x1f, 0x70, 0xe7, 0x0e, 0xf8, 0xff, 0x1f, 0x00, 0x00, 0xde, 0x07, 0xf0, 0xfb, 0x7f, 0x70, 0x38, 0x1c, 0x70, 0xe7, 0x0f, 0xb8, 0x61, 0x0c, 0x00, 0x00, 0xce, 0x0f, 0xb0, 0xd3, 0x75, 0x70, 0x38, 0x1c, 0xf0, 0xe7, 0x07, 0xb8, 0xff, 0x0e, 0x00, 0x00, 0xcf, 0x0f, 0x80, 0xc3, 0x71, 0xf0, 0xff, 0x1f, 0xe0, 0xe7, 0x03, 0xb8, 0xff, 0x0e, 0x00, 0x00, 0xc7, 0x1d, 0x80, 0xc3, 0x71, 0xf0, 0xff, 0x1f, 0xe0, 0xe7, 0x03, 0xb8, 0xe3, 0x0e, 0x00, 0x80, 0xc3, 0x3d, 0xc0, 0xc1, 0x71, 0xf0, 0xff, 0x7f, 0x60, 0xe7, 0x01, 0x9c, 0xff, 0x0e, 0x00, 0x80, 0xc3, 0xf9, 0xc0, 0xc1, 0x71, 0x70, 0x38, 0x74, 0x00, 0xe7, 0x00, 0x9c, 0xff, 0x0e, 0x00, 0xc0, 0xc1, 0xf1, 0xc3, 0xc1, 0x71, 0x00, 0x38, 0x70, 0x00, 0xe7, 0x10, 0x9c, 0x63, 0x0e, 0x00, 0xe0, 0xfc, 0xe1, 0xe3, 0xc0, 0x71, 0x00, 0x38, 0x70, 0xfe, 0xff, 0x3f, 0x8e, 0xe1, 0x0f, 0x00, 0x70, 0xfc, 0xc1, 0x70, 0xc0, 0x70, 0x00, 0xf8, 0xff, 0xfe, 0xff, 0x7f, 0x06, 0xe0, 0x0f, 0x00, 0x30, 0xe0, 0x00, 0x38, 0x00, 0x70, 0x00, 0xf8, 0x7f, 0xfe, 0xff, 0x7f, 0x07, 0x80, 0x0f, 0x00, 0x00, 0x60, 0x00, 0x18, 0x00, 0x30, 0x00, 0xf0, 0x3f, 0x00, 0x00, 0x00, 0x03, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
// width: 25, height: 11 电池图标 100%
const unsigned char barrier_100[] U8X8_PROGMEM = {0xf8, 0xff, 0xff, 0x01, 0x04, 0x00, 0x00, 0x01, 0x74, 0x77, 0x77, 0x01, 0x76, 0x77, 0x77, 0x01, 0x77, 0x77, 0x77, 0x01, 0x77, 0x77, 0x77, 0x01, 0x77, 0x77, 0x77, 0x01, 0x76, 0x77, 0x77, 0x01, 0x74, 0x77, 0x77, 0x01, 0x04, 0x00, 0x00, 0x01, 0xfc, 0xff, 0xff, 0x01};
// width: 25, height: 11 电池图标 80%
const unsigned char barrier_80[] U8X8_PROGMEM = {0xf8, 0xff, 0xff, 0x01, 0x04, 0x00, 0x00, 0x01, 0x04, 0x77, 0x77, 0x01, 0x06, 0x77, 0x77, 0x01, 0x07, 0x77, 0x77, 0x01, 0x07, 0x77, 0x77, 0x01, 0x07, 0x77, 0x77, 0x01, 0x06, 0x77, 0x77, 0x01, 0x04, 0x77, 0x77, 0x01, 0x04, 0x00, 0x00, 0x01, 0xfc, 0xff, 0xff, 0x01};
// width: 25, height: 11 电池图标 60%
const unsigned char barrier_60[] U8X8_PROGMEM = {0xf8, 0xff, 0xff, 0x01, 0x04, 0x00, 0x00, 0x01, 0x04, 0x70, 0x77, 0x01, 0x06, 0x70, 0x77, 0x01, 0x07, 0x70, 0x77, 0x01, 0x07, 0x70, 0x77, 0x01, 0x07, 0x70, 0x77, 0x01, 0x06, 0x70, 0x77, 0x01, 0x04, 0x70, 0x77, 0x01, 0x04, 0x00, 0x00, 0x01, 0xfc, 0xff, 0xff, 0x01};
// width: 25, height: 11 电池图标 40%
const unsigned char barrier_40[] U8X8_PROGMEM = {0xf8, 0xff, 0xff, 0x01, 0x04, 0x00, 0x00, 0x01, 0x04, 0x00, 0x77, 0x01, 0x06, 0x00, 0x77, 0x01, 0x07, 0x00, 0x77, 0x01, 0x07, 0x00, 0x77, 0x01, 0x07, 0x00, 0x77, 0x01, 0x06, 0x00, 0x77, 0x01, 0x04, 0x00, 0x77, 0x01, 0x04, 0x00, 0x00, 0x01, 0xfc, 0xff, 0xff, 0x01};
// width: 25, height: 11 电池图标 20%
const unsigned char barrier_20[] U8X8_PROGMEM = {0xf8, 0xff, 0xff, 0x01, 0x04, 0x00, 0x00, 0x01, 0x04, 0x00, 0x70, 0x01, 0x06, 0x00, 0x70, 0x01, 0x07, 0x00, 0x70, 0x01, 0x07, 0x00, 0x70, 0x01, 0x07, 0x00, 0x70, 0x01, 0x06, 0x00, 0x70, 0x01, 0x04, 0x00, 0x70, 0x01, 0x04, 0x00, 0x00, 0x01, 0xfc, 0xff, 0xff, 0x01};
// width: 25, height: 11 电池图标 00%
const unsigned char barrier_00[] U8X8_PROGMEM = {0xf8, 0xff, 0xff, 0x01, 0x04, 0x00, 0x00, 0x01, 0x04, 0x00, 0x00, 0x01, 0x06, 0x00, 0x00, 0x01, 0x07, 0x00, 0x00, 0x01, 0x07, 0x00, 0x00, 0x01, 0x07, 0x00, 0x00, 0x01, 0x06, 0x00, 0x00, 0x01, 0x04, 0x00, 0x00, 0x01, 0x04, 0x00, 0x00, 0x01, 0xfc, 0xff, 0xff, 0x01};
// width: 16, height: 16 GPS有效图标
const unsigned char GPS_OK[] U8X8_PROGMEM = {0x00, 0x00, 0xe0, 0x03, 0xf0, 0x07, 0xf8, 0x0f, 0x38, 0x1e, 0x1c, 0x1c, 0x1c, 0x38, 0x1c, 0x38, 0x1c, 0x1c, 0x38, 0x1e, 0xf8, 0x0f, 0xf0, 0x07, 0xe0, 0x07, 0xc0, 0x03, 0xc0, 0x01, 0x80, 0x00};
// width: 16, height: 16 GPS无效图标
const unsigned char GPS_NULL[] U8X8_PROGMEM = {0x00, 0xe0, 0xc0, 0xf3, 0xf0, 0xff, 0xf8, 0x7f, 0x38, 0x3e, 0x1c, 0x1f, 0x9c, 0x3f, 0xdc, 0x3f, 0xfc, 0x1f, 0xf8, 0x1f, 0xf8, 0x0f, 0xfc, 0x07, 0xfe, 0x07, 0xdf, 0x03, 0xcf, 0x01, 0x87, 0x00};
// width: 14, height: 19 蓝牙有效图标
const unsigned char Bluetooth_OK[] U8X8_PROGMEM = {0x00, 0x00, 0x00, 0x00, 0xf8, 0x03, 0xfc, 0x07, 0x3e, 0x0f, 0x3e, 0x0e, 0x3e, 0x0c, 0xa6, 0x0c, 0x0f, 0x1e, 0x1f, 0x1f, 0x1f, 0x1f, 0x0f, 0x1e, 0x06, 0x0c, 0xb6, 0x0c, 0x3e, 0x0e, 0x3e, 0x0f, 0xbc, 0x07, 0xf8, 0x03, 0x40, 0x00};
// width: 14, height: 19 蓝牙无效图标
const unsigned char Bluetooth_NULL[] U8X8_PROGMEM = {0x00, 0x00, 0x00, 0x00, 0xf8, 0x03, 0xfc, 0x01, 0x3e, 0x01, 0x3e, 0x00, 0x3e, 0x08, 0x26, 0x0c, 0x0f, 0x1e, 0x1f, 0x1e, 0x0f, 0x1f, 0x07, 0x1e, 0x06, 0x0c, 0x82, 0x0c, 0x20, 0x0e, 0x30, 0x0f, 0xb8, 0x07, 0xf8, 0x03, 0x40, 0x00};

// width: 24, height: 16
const unsigned char better_0[] U8X8_PROGMEM = {
    0x00,
    0x00,
    0x00,
    0xFE,
    0xFF,
    0x1F,
    0x02,
    0x00,
    0x10,
    0x02,
    0x00,
    0x10,
    0x02,
    0x00,
    0x10,
    0x02,
    0x00,
    0x70,
    0x02,
    0x00,
    0x40,
    0x02,
    0x00,
    0x40,
    0x02,
    0x00,
    0x40,
    0x02,
    0x00,
    0x40,
    0x02,
    0x00,
    0x70,
    0x02,
    0x00,
    0x10,
    0x02,
    0x00,
    0x10,
    0x02,
    0x00,
    0x10,
    0xFE,
    0xFF,
    0x1F,
    0x00,
    0x00,
    0x00,
};
const unsigned char better_25[] U8X8_PROGMEM = {
    0x00,
    0x00,
    0x00,
    0xFE,
    0xFF,
    0x1F,
    0x02,
    0x00,
    0x10,
    0x3A,
    0x00,
    0x10,
    0x3A,
    0x00,
    0x10,
    0x3A,
    0x00,
    0x70,
    0x3A,
    0x00,
    0x40,
    0x3A,
    0x00,
    0x40,
    0x3A,
    0x00,
    0x40,
    0x3A,
    0x00,
    0x40,
    0x3A,
    0x00,
    0x70,
    0x3A,
    0x00,
    0x10,
    0x3A,
    0x00,
    0x10,
    0x02,
    0x00,
    0x10,
    0xFE,
    0xFF,
    0x1F,
    0x00,
    0x00,
    0x00,
};
const unsigned char better_50[] U8X8_PROGMEM = {
    0x00,
    0x00,
    0x00,
    0xFE,
    0xFF,
    0x1F,
    0x02,
    0x00,
    0x10,
    0xBA,
    0x03,
    0x10,
    0xBA,
    0x03,
    0x10,
    0xBA,
    0x03,
    0x70,
    0xBA,
    0x03,
    0x40,
    0xBA,
    0x03,
    0x40,
    0xBA,
    0x03,
    0x40,
    0xBA,
    0x03,
    0x40,
    0xBA,
    0x03,
    0x70,
    0xBA,
    0x03,
    0x10,
    0xBA,
    0x03,
    0x10,
    0x02,
    0x00,
    0x10,
    0xFE,
    0xFF,
    0x1F,
    0x00,
    0x00,
    0x00,
};
const unsigned char better_75[] U8X8_PROGMEM = {
    0x00,
    0x00,
    0x00,
    0xFE,
    0xFF,
    0x1F,
    0x02,
    0x00,
    0x10,
    0xBA,
    0x3B,
    0x10,
    0xBA,
    0x3B,
    0x10,
    0xBA,
    0x3B,
    0x70,
    0xBA,
    0x3B,
    0x40,
    0xBA,
    0x3B,
    0x40,
    0xBA,
    0x3B,
    0x40,
    0xBA,
    0x3B,
    0x40,
    0xBA,
    0x3B,
    0x70,
    0xBA,
    0x3B,
    0x10,
    0xBA,
    0x3B,
    0x10,
    0x02,
    0x00,
    0x10,
    0xFE,
    0xFF,
    0x1F,
    0x00,
    0x00,
    0x00,
};
const unsigned char better_100[] U8X8_PROGMEM = {
    0x00,
    0x00,
    0x00,
    0xFE,
    0xFF,
    0x1F,
    0x02,
    0x00,
    0x10,
    0xBA,
    0xBB,
    0x13,
    0xBA,
    0xBB,
    0x13,
    0xBA,
    0xBB,
    0x73,
    0xBA,
    0xBB,
    0x43,
    0xBA,
    0xBB,
    0x43,
    0xBA,
    0xBB,
    0x43,
    0xBA,
    0xBB,
    0x43,
    0xBA,
    0xBB,
    0x73,
    0xBA,
    0xBB,
    0x13,
    0xBA,
    0xBB,
    0x13,
    0x02,
    0x00,
    0x10,
    0xFE,
    0xFF,
    0x1F,
    0x00,
    0x00,
    0x00,
};
const unsigned char GPS[] U8X8_PROGMEM = {
    0x00,
    0x00,
    0x00,
    0x3C,
    0x00,
    0x1E,
    0x04,
    0x7E,
    0x10,
    0x04,
    0xC3,
    0x10,
    0x84,
    0x81,
    0x11,
    0xC0,
    0x00,
    0x00,
    0x40,
    0x00,
    0x00,
    0x40,
    0xF8,
    0x03,
    0x40,
    0x00,
    0x02,
    0xC0,
    0x00,
    0x01,
    0x80,
    0x81,
    0x01,
    0x04,
    0xC3,
    0x10,
    0x04,
    0x7E,
    0x10,
    0x04,
    0x00,
    0x10,
    0x3C,
    0x00,
    0x1E,
    0x00,
    0x00,
    0x00};

const unsigned char None[] U8X8_PROGMEM = {
    0x00, 0x00, 0x00, 0x3C, 0x00, 0x1E, 0x04, 0x00, 0x10, 0x04, 0x00, 0x10, 0x04, 0x00, 0x10, 0x00,
    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
    0x00, 0x04, 0x00, 0x10, 0x04, 0x00, 0x10, 0x04, 0x00, 0x10, 0x3C, 0x00, 0x1E, 0x00, 0x00, 0x00};
const unsigned char BLue[] U8X8_PROGMEM = {
    0x00, 0x00, 0x00, 0x3C, 0x18, 0x1E, 0x04, 0x28, 0x10, 0x84, 0x48, 0x10, 0x04, 0x89, 0x10, 0x00,
    0x4A, 0x00, 0x00, 0x2C, 0x00, 0x00, 0x18, 0x00, 0x00, 0x2C, 0x00, 0x00, 0x4A, 0x00, 0x00, 0x89,
    0x00, 0x84, 0x48, 0x10, 0x04, 0x28, 0x10, 0x04, 0x18, 0x10, 0x3C, 0x00, 0x1E, 0x00, 0x00, 0x00};

const unsigned char R[] U8X8_PROGMEM = {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFE, 0xFF, 0x00, 0x70, 0xC0, 0x03, 0x70, 0x00,
                                        0x07, 0x70, 0x00, 0x0E, 0x70, 0x00, 0x1E, 0x70, 0x00, 0x1C, 0x70, 0x00, 0x1C, 0x70, 0x00, 0x1C,
                                        0x70, 0x00, 0x1C, 0x70, 0x00, 0x1C, 0x70, 0x00, 0x1C, 0x70, 0x00, 0x0E, 0x70, 0x00, 0x0E, 0x70,
                                        0x00, 0x07, 0x70, 0xC0, 0x03, 0xF0, 0xFF, 0x00, 0x70, 0x30, 0x00, 0x70, 0x70, 0x00, 0x70, 0x70,
                                        0x00, 0x70, 0xE0, 0x00, 0x70, 0xE0, 0x00, 0x70, 0xE0, 0x00, 0x70, 0xC0, 0x01, 0x70, 0xC0, 0x01,
                                        0x70, 0x80, 0x03, 0x70, 0x80, 0x03, 0x70, 0x80, 0x03, 0x70, 0x00, 0x07, 0x70, 0x00, 0x07, 0x70,
                                        0x00, 0x0F, 0x70, 0x00, 0x0E, 0x70, 0x00, 0x1E, 0xFE, 0x03, 0x7C, 0x00, 0x00, 0x00, 0x00, 0x00,
                                        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
const unsigned char C[] U8X8_PROGMEM = {
    0x00,
    0x00,
    0x00,
    0x00,
    0x00,
    0x00,
    0x00,
    0x00,
    0x00,
    0x00,
    0x00,
    0x00,
    0x00,
    0x00,
    0x00,
    0x00,
    0x00,
    0x00,
    0x00,
    0x00,
    0x00,
    0x00,
    0x00,
    0x00,
    0x00,
    0xFC,
    0x00,
    0x00,
    0x07,
    0x1F,
    0x80,
    0x01,
    0x1C,
    0xC0,
    0x00,
    0x18,
    0xE0,
    0x00,
    0x18,
    0x60,
    0x00,
    0x10,
    0x70,
    0x00,
    0x30,
    0x30,
    0x00,
    0x20,
    0x38,
    0x00,
    0x00,
    0x38,
    0x00,
    0x00,
    0x18,
    0x00,
    0x00,
    0x1C,
    0x00,
    0x00,
    0x1C,
    0x00,
    0x00,
    0x1C,
    0x00,
    0x00,
    0x1C,
    0x00,
    0x00,
    0x1C,
    0x00,
    0x00,
    0x1C,
    0x00,
    0x00,
    0x1C,
    0x00,
    0x00,
    0x1C,
    0x00,
    0x00,
    0x1C,
    0x00,
    0x00,
    0x1C,
    0x00,
    0x00,
    0x1C,
    0x00,
    0x00,
    0x1C,
    0x00,
    0x00,
    0x38,
    0x00,
    0x20,
    0x38,
    0x00,
    0x20,
    0x38,
    0x00,
    0x10,
    0x70,
    0x00,
    0x10,
    0x70,
    0x00,
    0x18,
    0xE0,
    0x00,
    0x0C,
    0xE0,
    0x01,
    0x06,
    0xC0,
    0x03,
    0x07,
    0x00,
    0xFF,
    0x01,
    0x00,
    0xFC,
    0x00,
    0x00,
    0x00,
    0x00,
    0x00,
    0x00,
    0x00,
    0x00,
    0x00,
    0x00,
    0x00,
    0x00,
    0x00,
    0x00,
    0x00,
    0x00,
    0x00,
    0x00,
    0x00,
    0x00,
    0x00,
    0x00,
};
const unsigned char IR[] U8X8_PROGMEM = {
    0x00,
    0x00,
    0x00,
    0x00,
    0x00,
    0x00,
    0x00,
    0x00,
    0xE0,
    0xFF,
    0xFF,
    0xFF,
    0xFF,
    0xFF,
    0x3F,
    0x00,
    0xF0,
    0xFF,
    0xFF,
    0xFF,
    0xFF,
    0xFF,
    0x7F,
    0x00,
    0xF8,
    0xFF,
    0xFF,
    0xFF,
    0xFF,
    0xFF,
    0xFF,
    0x00,
    0x0C,
    0x00,
    0x00,
    0x00,
    0x00,
    0x00,
    0x80,
    0x01,
    0x0E,
    0x00,
    0x00,
    0x00,
    0x00,
    0x00,
    0x80,
    0x03,
    0x0E,
    0x00,
    0x00,
    0x00,
    0x00,
    0x00,
    0x80,
    0x03,
    0x0E,
    0x00,
    0x00,
    0x00,
    0x00,
    0x00,
    0x80,
    0x03,
    0x0E,
    0x00,
    0x00,
    0x00,
    0x00,
    0x00,
    0x80,
    0x03,
    0x0E,
    0x00,
    0x00,
    0x00,
    0x00,
    0x00,
    0x80,
    0x03,
    0x0E,
    0x00,
    0x00,
    0x00,
    0x00,
    0x00,
    0x80,
    0x03,
    0x0E,
    0x00,
    0x00,
    0x00,
    0x00,
    0x00,
    0x80,
    0x03,
    0x0E,
    0x00,
    0x00,
    0x00,
    0x00,
    0x00,
    0x80,
    0x03,
    0x0E,
    0x00,
    0x00,
    0x00,
    0x00,
    0x00,
    0x80,
    0x03,
    0x0E,
    0x00,
    0x00,
    0x00,
    0x00,
    0x00,
    0x80,
    0x03,
    0x0E,
    0x00,
    0x00,
    0x00,
    0x00,
    0x00,
    0x80,
    0x03,
    0x0E,
    0x00,
    0x00,
    0x00,
    0x00,
    0x00,
    0x80,
    0x03,
    0x0E,
    0x00,
    0x00,
    0x00,
    0x00,
    0x00,
    0x80,
    0x03,
    0x0E,
    0x00,
    0x00,
    0x00,
    0x00,
    0x00,
    0x80,
    0x03,
    0x0E,
    0x00,
    0x00,
    0x00,
    0x00,
    0x00,
    0x80,
    0x03,
    0x0E,
    0x60,
    0x00,
    0x00,
    0x1C,
    0x18,
    0x80,
    0x03,
    0x0E,
    0x70,
    0xFC,
    0x1F,
    0x1C,
    0x18,
    0x80,
    0x03,
    0x0E,
    0x70,
    0xFC,
    0x1F,
    0x1C,
    0x18,
    0x80,
    0x03,
    0x0E,
    0x38,
    0xFC,
    0x1F,
    0xFE,
    0x19,
    0x80,
    0x03,
    0x0E,
    0x9C,
    0xC3,
    0x01,
    0xFE,
    0x19,
    0x80,
    0x03,
    0x0E,
    0xDC,
    0xC3,
    0x01,
    0xCE,
    0x79,
    0x80,
    0x03,
    0x0E,
    0xFE,
    0xC1,
    0x01,
    0x87,
    0xF9,
    0x80,
    0x03,
    0x0E,
    0xFC,
    0xC0,
    0x81,
    0xC7,
    0xF9,
    0x81,
    0x03,
    0x0E,
    0xF0,
    0xC0,
    0x81,
    0xC3,
    0xF9,
    0x81,
    0x03,
    0x0E,
    0x70,
    0xC0,
    0x81,
    0xCF,
    0x99,
    0x83,
    0x03,
    0x0E,
    0x38,
    0xC0,
    0x81,
    0xFD,
    0x98,
    0x87,
    0x03,
    0x0E,
    0xFC,
    0xC1,
    0x01,
    0xF8,
    0x18,
    0x83,
    0x03,
    0x0E,
    0xFC,
    0xC1,
    0x01,
    0x70,
    0x18,
    0x80,
    0x03,
    0x0E,
    0xFC,
    0xC0,
    0x01,
    0x78,
    0x18,
    0x80,
    0x03,
    0x0E,
    0x00,
    0xC0,
    0x01,
    0x3C,
    0x18,
    0x80,
    0x03,
    0x0E,
    0xF8,
    0xC1,
    0x01,
    0x1E,
    0x18,
    0x80,
    0x03,
    0x0E,
    0xFC,
    0xFF,
    0x1F,
    0x1F,
    0x18,
    0x80,
    0x03,
    0x0E,
    0xFC,
    0xFF,
    0x9F,
    0x0F,
    0x18,
    0x80,
    0x03,
    0x0E,
    0x00,
    0xFE,
    0x1F,
    0x07,
    0x18,
    0x80,
    0x03,
    0x0E,
    0x00,
    0x00,
    0x00,
    0x00,
    0x18,
    0x80,
    0x03,
    0x0E,
    0x00,
    0x00,
    0x00,
    0x00,
    0x00,
    0x80,
    0x03,
    0x0E,
    0x00,
    0x00,
    0x00,
    0x00,
    0x00,
    0x80,
    0x03,
    0x0E,
    0x00,
    0x00,
    0x00,
    0x00,
    0x00,
    0x80,
    0x03,
    0x0E,
    0x00,
    0x00,
    0x00,
    0x00,
    0x00,
    0x80,
    0x03,
    0x0E,
    0x00,
    0x00,
    0x00,
    0x00,
    0x00,
    0x80,
    0x03,
    0x0E,
    0x00,
    0x00,
    0x00,
    0x00,
    0x00,
    0x80,
    0x03,
    0x0E,
    0x00,
    0x00,
    0x00,
    0x00,
    0x00,
    0x80,
    0x03,
    0x0E,
    0x00,
    0x00,
    0x00,
    0x00,
    0x00,
    0x80,
    0x03,
    0x0E,
    0x00,
    0x00,
    0x00,
    0x00,
    0x00,
    0x80,
    0x03,
    0x0E,
    0x00,
    0x00,
    0x00,
    0x00,
    0x00,
    0x80,
    0x03,
    0x0E,
    0x00,
    0x00,
    0x00,
    0x00,
    0x00,
    0x80,
    0x03,
    0x0E,
    0x00,
    0x00,
    0x00,
    0x00,
    0x00,
    0x80,
    0x03,
    0x0E,
    0x00,
    0x00,
    0x00,
    0x00,
    0x00,
    0x80,
    0x03,
    0x0E,
    0x00,
    0x00,
    0x00,
    0x00,
    0x00,
    0x80,
    0x03,
    0x0E,
    0x00,
    0x00,
    0x00,
    0x00,
    0x00,
    0x80,
    0x03,
    0x0C,
    0x00,
    0x00,
    0x00,
    0x00,
    0x00,
    0x80,
    0x01,
    0xF8,
    0xFF,
    0xFF,
    0xFF,
    0xFF,
    0xFF,
    0xFF,
    0x00,
    0xF0,
    0xFF,
    0xFF,
    0xFF,
    0xFF,
    0xFF,
    0x7F,
    0x00,
    0xE0,
    0xFF,
    0xFF,
    0xFF,
    0xFF,
    0xFF,
    0x3F,
    0x00,
    0x00,
    0x00,
    0x00,
    0x00,
    0x00,
    0x00,
    0x00,
    0x00,
};

const unsigned char RFID[] U8X8_PROGMEM = {

    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xF8, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1E, 0x1E, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x07, 0xF8, 0x00, 0x00, 0x00, 0x00, 0x00, 0xE0, 0x01, 0xE0, 0x03, 0x00, 0xFF, 0xFF, 0x3F, 0x60, 0x00, 0x80, 0x07, 0x80, 0xFF, 0xFF, 0x1F, 0x00, 0x00, 0x00, 0x0C, 0xC0, 0xFF, 0xFF, 0x0F, 0x00, 0xE0, 0x03, 0x0C, 0x60, 0x00, 0x00, 0x00, 0x00, 0x18, 0x0C, 0x1C, 0x70, 0x00, 0x00, 0x00, 0x00, 0x0C, 0x30, 0x18, 0x70, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x30, 0x70, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x30, 0x70, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x60, 0x70, 0x00, 0x00, 0x00, 0x00, 0x80, 0x81, 0x60, 0x70, 0x00, 0x00, 0x00, 0x00, 0xC0, 0x03, 0x41, 0x70, 0x00, 0x00, 0x00, 0x00, 0xC0, 0x03, 0x41, 0x70, 0x00, 0x00, 0x00, 0x00, 0x80, 0x01, 0x41, 0x70, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x41, 0x70, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x41, 0x70, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x40, 0x70, 0x00, 0x00, 0x00, 0x00, 0x00, 0xC0, 0x40, 0x70, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x30, 0x70, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30, 0x70, 0x80, 0x03, 0x18, 0xE0, 0x00, 0x00, 0x18, 0x70, 0x80, 0x01, 0x18, 0xE0, 0xFC, 0x1F, 0x18, 0x70, 0x80, 0x01, 0x18, 0xE0, 0xFC, 0x1F, 0x0C, 0x70, 0x80, 0x01, 0x18, 0xEC, 0xE0, 0x00, 0x0C, 0x70, 0xF0, 0x1F, 0x18, 0xEC, 0x67, 0x00, 0x00, 0x70, 0x70, 0x1C, 0x18, 0xEC, 0x60, 0x00, 0x00, 0x70, 0xF0, 0xFF, 0xFF, 0xED, 0xF8, 0x0F, 0x00, 0x70, 0x70, 0x1C, 0x18, 0xEC, 0x18, 0x0C, 0x00, 0x70, 0x70, 0x1C, 0x18, 0xEC, 0x18, 0x0C, 0x00, 0x70, 0x70, 0x1C, 0x18, 0xFE, 0xDF, 0x0C, 0x00, 0x70, 0x70, 0x1C, 0x18, 0x00, 0xD8, 0x0C, 0x10, 0x70, 0xF0, 0x7F, 0x18, 0xE0, 0xD8, 0x0C, 0x18, 0x70, 0x70, 0xFC, 0x18, 0xEC, 0xD8, 0x0C, 0x1C, 0x70, 0x70, 0xDC, 0x18, 0xEC, 0xDE, 0x0C, 0x1C, 0x70, 0xF8, 0x9F, 0x1B, 0xEC, 0xDE, 0x0C, 0x1C, 0x70, 0x00, 0x1E, 0x18, 0xEC, 0xDF, 0x0C, 0x1C, 0x70, 0x00, 0x1E, 0x18, 0xE6, 0xFB, 0x0C, 0x1C, 0x70, 0x00, 0x1E, 0x18, 0xE6, 0xE1, 0x03, 0x1C, 0x70, 0x00, 0x1F, 0x18, 0xF0, 0x30, 0x07, 0x1C, 0x70, 0xE0, 0x1D, 0x18, 0x1C, 0x1C, 0x1C, 0x1C, 0x70, 0xF0, 0x0C, 0x18, 0x1C, 0x1C, 0x1C, 0x1C, 0x70, 0x18, 0xCF, 0x0F, 0x0E, 0x06, 0x18, 0x1C, 0x70, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1C, 0x70, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1C, 0x70, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1C, 0x70, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1C, 0x70, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1C, 0x70, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1C, 0x70, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1C, 0x70, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1C, 0x70, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1C, 0x70, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1C, 0x70, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1C, 0x70, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1C, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0C, 0xC0, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x07, 0x80, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x03, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};

const unsigned char OLED[] U8X8_PROGMEM = {

    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xE0, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x3F, 0x00,
    0xF0, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x7F, 0x00, 0xF8, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00,
    0x0C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x01, 0x0E, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x03,
    0x0E, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x03, 0x0E, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x03,
    0x0E, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x03, 0x0E, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x03,
    0x0E, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x03, 0x0E, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x03,
    0x0E, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x03, 0x0E, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x03,
    0x0E, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x03, 0x0E, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x03,
    0x0E, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x03, 0x0E, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x03,
    0x0E, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x03, 0x0E, 0xFE, 0xFF, 0x01, 0xFE, 0xFF, 0x8F, 0x03,
    0x0E, 0x06, 0x80, 0x01, 0x00, 0x00, 0x80, 0x03, 0x0E, 0x06, 0x80, 0x01, 0x00, 0x00, 0x80, 0x03,
    0x0E, 0x06, 0x80, 0x01, 0x00, 0x00, 0x80, 0x03, 0x0E, 0xFE, 0xFF, 0x01, 0x00, 0x00, 0x80, 0x03,
    0x0E, 0xFE, 0xFF, 0x01, 0x00, 0x00, 0x80, 0x03, 0x0E, 0x06, 0x80, 0x01, 0x00, 0x00, 0x80, 0x03,
    0x0E, 0x06, 0x80, 0x81, 0xFF, 0xFF, 0x9F, 0x03, 0x0E, 0xFE, 0xFF, 0x01, 0x00, 0x1E, 0x80, 0x03,
    0x0E, 0xFE, 0xFF, 0x01, 0x00, 0x1E, 0x80, 0x03, 0x0E, 0x06, 0x80, 0x01, 0x10, 0x9E, 0x80, 0x03,
    0x8E, 0xE3, 0x0C, 0x03, 0x78, 0xDE, 0x81, 0x03, 0x8E, 0xE7, 0x8C, 0x03, 0x1C, 0x9E, 0x83, 0x03,
    0x8E, 0xE7, 0x8C, 0x03, 0x1C, 0x9E, 0x83, 0x03, 0x0E, 0xE6, 0x8C, 0x01, 0x0C, 0x1E, 0x83, 0x03,
    0x0E, 0xEC, 0xCC, 0x00, 0x06, 0x1E, 0x8E, 0x03, 0x0E, 0xEC, 0xCC, 0x80, 0x07, 0x1E, 0x9E, 0x03,
    0x0E, 0xEC, 0xCC, 0x80, 0x07, 0x1E, 0x9E, 0x03, 0x0E, 0xE0, 0x0C, 0x80, 0x03, 0x1E, 0x9C, 0x03,
    0xCE, 0xFF, 0xFF, 0x07, 0x00, 0x1E, 0x80, 0x03, 0xCE, 0xFF, 0xFF, 0x07, 0x00, 0x1E, 0x80, 0x03,
    0x0E, 0x00, 0x00, 0x00, 0xF0, 0x07, 0x80, 0x03, 0x0E, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x03,
    0x0E, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x03, 0x0E, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x03,
    0x0E, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x03, 0x0E, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x03,
    0x0E, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x03, 0x0E, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x03,
    0x0E, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x03, 0x0E, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x03,
    0x0E, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x03, 0x0E, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x03,
    0x0E, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x03, 0x0E, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x03,
    0x0E, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x03, 0x0C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x01,
    0xF8, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0xF0, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x7F, 0x00,
    0xE0, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x3F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};

const unsigned char CAM[] U8X8_PROGMEM = {

    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xE0, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x3F, 0x00,
    0xF0, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x7F, 0x00, 0xF8, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00,
    0x0C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x01, 0x0E, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x03,
    0xCE, 0x03, 0x00, 0x00, 0x00, 0x00, 0x9F, 0x03, 0x4E, 0x00, 0x00, 0x00, 0x00, 0x00, 0x90, 0x03,
    0x4E, 0x00, 0x00, 0x00, 0x00, 0x00, 0x90, 0x03, 0x4E, 0x00, 0x00, 0x00, 0x00, 0x00, 0x90, 0x03,
    0x0E, 0x00, 0x00, 0x00, 0x00, 0x00, 0x90, 0x03, 0x0E, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x03,
    0x0E, 0xFC, 0xFF, 0xFF, 0xFF, 0xFF, 0x81, 0x03, 0x0E, 0xFC, 0xFF, 0xFF, 0xFF, 0xFF, 0x81, 0x03,
    0x0E, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x03, 0x0E, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x03,
    0x0E, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x03, 0x0E, 0xE4, 0x26, 0x6E, 0x78, 0x88, 0x81, 0x03,
    0x0E, 0xE4, 0x26, 0x6E, 0x78, 0x88, 0x81, 0x03, 0x0E, 0xE4, 0x26, 0x6E, 0x78, 0x88, 0x81, 0x03,
    0x0E, 0xE4, 0x26, 0x6E, 0x78, 0x88, 0x81, 0x03, 0x0E, 0xE4, 0x26, 0x6E, 0x78, 0x88, 0x81, 0x03,
    0x0E, 0xE4, 0x26, 0x6E, 0x78, 0x88, 0x81, 0x03, 0x0E, 0xE4, 0x26, 0x6E, 0x78, 0x88, 0x81, 0x03,
    0x0E, 0xE4, 0x26, 0x6E, 0x78, 0x88, 0x81, 0x03, 0x0E, 0xE4, 0x26, 0x6E, 0x78, 0x88, 0x81, 0x03,
    0x0E, 0xE4, 0x26, 0x6E, 0x78, 0x88, 0x81, 0x03, 0x0E, 0xE4, 0x26, 0x6E, 0x78, 0x88, 0x81, 0x03,
    0x0E, 0xE4, 0x26, 0x6E, 0x78, 0x88, 0x81, 0x03, 0x0E, 0xE4, 0x26, 0x6E, 0x78, 0x88, 0x81, 0x03,
    0x0E, 0xE4, 0x26, 0x6E, 0x78, 0x88, 0x81, 0x03, 0x0E, 0xE4, 0x26, 0x6E, 0x78, 0x88, 0x81, 0x03,
    0x0E, 0xE4, 0x26, 0x6E, 0x78, 0x88, 0x81, 0x03, 0x0E, 0xE4, 0x26, 0x6E, 0x78, 0x88, 0x81, 0x03,
    0x0E, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x03, 0x4E, 0x00, 0x00, 0x00, 0x00, 0x00, 0x90, 0x03,
    0x4E, 0x00, 0x00, 0x00, 0x00, 0x00, 0x90, 0x03, 0x4E, 0x00, 0x00, 0x00, 0x00, 0x00, 0x90, 0x03,
    0xCE, 0xE3, 0x00, 0x00, 0x00, 0x00, 0x9E, 0x03, 0x0E, 0xE0, 0xFC, 0x0F, 0xE0, 0x3F, 0x80, 0x03,
    0x0E, 0xE0, 0x00, 0xEC, 0x1F, 0x18, 0x80, 0x03, 0x0E, 0xF8, 0x03, 0x0C, 0xE3, 0x18, 0x80, 0x03,
    0x0E, 0xE0, 0x00, 0x0C, 0x63, 0x18, 0x80, 0x03, 0x0E, 0xE0, 0x00, 0x8C, 0x63, 0x18, 0x80, 0x03,
    0x0E, 0xE0, 0x00, 0x8C, 0x61, 0x1C, 0x80, 0x03, 0x0E, 0xE0, 0xFF, 0xCF, 0x6F, 0x0C, 0x80, 0x03,
    0x0E, 0xF0, 0x00, 0xEC, 0xED, 0x7F, 0x80, 0x03, 0x0E, 0xF8, 0x00, 0xEC, 0x0D, 0x70, 0x80, 0x03,
    0x0E, 0xE0, 0x00, 0x8C, 0x0D, 0x70, 0x80, 0x03, 0x0E, 0xE0, 0x00, 0x8C, 0xFD, 0x3F, 0x80, 0x03,
    0x0E, 0xE0, 0x00, 0x8C, 0x0D, 0x30, 0x80, 0x03, 0x0E, 0xE0, 0x00, 0x8C, 0x0D, 0x30, 0x80, 0x03,
    0x0E, 0xE0, 0x00, 0x8C, 0x0F, 0x30, 0x80, 0x03, 0x0E, 0x78, 0xFE, 0x8F, 0x0D, 0x3F, 0x80, 0x03,
    0x0E, 0x00, 0x00, 0x0C, 0x00, 0x00, 0x80, 0x03, 0x0C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x01,
    0xF8, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0xF0, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x7F, 0x00,
    0xE0, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x3F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};

const unsigned char SYS[] U8X8_PROGMEM = {

    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xE0, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x3F, 0x00,
    0xF0, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x7F, 0x00, 0xF8, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00,
    0x0C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x01, 0x0E, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x03,
    0x0E, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x03, 0x0E, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x03,
    0x0E, 0x00, 0x00, 0xF8, 0x3F, 0x00, 0x80, 0x03, 0x0E, 0x00, 0x00, 0x04, 0x20, 0x00, 0x80, 0x03,
    0x0E, 0x00, 0x00, 0x02, 0x20, 0x00, 0x80, 0x03, 0x0E, 0x00, 0x00, 0x01, 0x20, 0x00, 0x80, 0x03,
    0x0E, 0x00, 0x00, 0x01, 0x20, 0x00, 0x80, 0x03, 0x0E, 0x00, 0x80, 0x00, 0x20, 0x00, 0x80, 0x03,
    0x0E, 0x00, 0x40, 0x00, 0x20, 0x00, 0x80, 0x03, 0x0E, 0x00, 0x20, 0x00, 0x20, 0x00, 0x80, 0x03,
    0x0E, 0x00, 0x10, 0x00, 0x20, 0x00, 0x80, 0x03, 0x0E, 0x00, 0x08, 0x00, 0x20, 0x00, 0x80, 0x03,
    0x0E, 0x00, 0x08, 0x00, 0x20, 0x00, 0x80, 0x03, 0x0E, 0x00, 0x08, 0x00, 0x20, 0x00, 0x80, 0x03,
    0x0E, 0x00, 0x08, 0x00, 0x20, 0x00, 0x80, 0x03, 0x0E, 0x00, 0x08, 0x00, 0x20, 0x00, 0x80, 0x03,
    0x0E, 0x00, 0x08, 0x00, 0x20, 0x00, 0x80, 0x03, 0x0E, 0x00, 0x08, 0x00, 0x20, 0x00, 0x80, 0x03,
    0x0E, 0x00, 0xF8, 0xFF, 0x3F, 0x00, 0x80, 0x03, 0x0E, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x03,
    0x0E, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x03, 0x0E, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x03,
    0x0E, 0x00, 0x00, 0x00, 0x83, 0x07, 0x80, 0x03, 0x0E, 0x00, 0xE0, 0x8F, 0x83, 0x0F, 0x80, 0x03,
    0x0E, 0xFC, 0x7F, 0x80, 0x01, 0x0F, 0x80, 0x03, 0x0E, 0x00, 0x1F, 0xC0, 0xFD, 0xFF, 0x81, 0x03,
    0x0E, 0xC0, 0x01, 0xC3, 0xC0, 0x00, 0x80, 0x03, 0x0E, 0xC0, 0x01, 0xC3, 0xC0, 0x00, 0x80, 0x03,
    0x0E, 0xC0, 0x01, 0xC3, 0xC0, 0x00, 0x80, 0x03, 0x0E, 0x60, 0xC0, 0xE7, 0xE6, 0x30, 0x80, 0x03,
    0x0E, 0xF0, 0xFF, 0x60, 0x7E, 0x70, 0x80, 0x03, 0x0E, 0x78, 0x7E, 0xE0, 0x3B, 0x60, 0x80, 0x03,
    0x0E, 0x00, 0x9F, 0x81, 0xFB, 0xFF, 0x80, 0x03, 0x0E, 0x80, 0x81, 0x83, 0x61, 0xD8, 0x81, 0x03,
    0x0E, 0xE0, 0x00, 0xC7, 0x60, 0x18, 0x80, 0x03, 0x0E, 0xF0, 0xFF, 0xEF, 0x67, 0x18, 0x80, 0x03,
    0x0E, 0x18, 0x3E, 0xFC, 0x60, 0x18, 0x80, 0x03, 0x0E, 0x60, 0xBE, 0x01, 0x7E, 0x98, 0x81, 0x03,
    0x0E, 0x70, 0xFE, 0xC3, 0x33, 0x98, 0x81, 0x03, 0x0E, 0x70, 0xFE, 0xC3, 0x33, 0x98, 0x81, 0x03,
    0x0E, 0x70, 0xFE, 0xC3, 0x33, 0x98, 0x81, 0x03, 0x0E, 0x1C, 0x3E, 0x6E, 0x18, 0x98, 0x81, 0x03,
    0x0E, 0xCE, 0x1F, 0x1C, 0x0E, 0xF8, 0x80, 0x03, 0x0E, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x03,
    0x0E, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x03, 0x0E, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x03,
    0x0E, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x03, 0x0E, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x03,
    0x0E, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x03, 0x0C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x01,
    0xF8, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0xF0, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x7F, 0x00,
    0xE0, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x3F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};

const unsigned char RETURN[] U8X8_PROGMEM = {
    0x00,
    0x00,
    0x00,
    0x00,
    0x00,
    0x00,
    0x00,
    0x00,
    0xE0,
    0xFF,
    0xFF,
    0xFF,
    0xFF,
    0xFF,
    0x3F,
    0x00,
    0xF0,
    0xFF,
    0xFF,
    0xFF,
    0xFF,
    0xFF,
    0x7F,
    0x00,
    0xF8,
    0xFF,
    0xFF,
    0xFF,
    0xFF,
    0xFF,
    0xFF,
    0x00,
    0x0C,
    0x00,
    0x00,
    0x00,
    0x00,
    0x00,
    0x80,
    0x01,
    0x0E,
    0x00,
    0x00,
    0x00,
    0x00,
    0x00,
    0x80,
    0x03,
    0x0E,
    0x00,
    0x00,
    0x00,
    0x00,
    0x00,
    0x80,
    0x03,
    0x0E,
    0x00,
    0x00,
    0x00,
    0x00,
    0x00,
    0x80,
    0x03,
    0x0E,
    0x00,
    0x00,
    0x00,
    0x00,
    0x00,
    0x80,
    0x03,
    0x0E,
    0x00,
    0x00,
    0x00,
    0x00,
    0x00,
    0x80,
    0x03,
    0x0E,
    0x00,
    0x10,
    0x00,
    0x00,
    0x00,
    0x80,
    0x03,
    0x0E,
    0x00,
    0x28,
    0x00,
    0x00,
    0x00,
    0x80,
    0x03,
    0x0E,
    0x00,
    0x44,
    0x00,
    0x00,
    0x00,
    0x80,
    0x03,
    0x0E,
    0x00,
    0x82,
    0x00,
    0x00,
    0x00,
    0x80,
    0x03,
    0x0E,
    0x00,
    0x41,
    0x00,
    0x00,
    0x00,
    0x80,
    0x03,
    0x0E,
    0x80,
    0x20,
    0x00,
    0x00,
    0x00,
    0x80,
    0x03,
    0x0E,
    0x40,
    0x10,
    0x00,
    0x00,
    0x00,
    0x80,
    0x03,
    0x0E,
    0x20,
    0x08,
    0x00,
    0x00,
    0x00,
    0x80,
    0x03,
    0x0E,
    0x10,
    0x04,
    0x00,
    0x00,
    0x00,
    0x80,
    0x03,
    0x0E,
    0x08,
    0x02,
    0x00,
    0x00,
    0x00,
    0x80,
    0x03,
    0x0E,
    0x04,
    0xFE,
    0xFF,
    0xFF,
    0x3F,
    0x80,
    0x03,
    0x0E,
    0x02,
    0x00,
    0x00,
    0x00,
    0x40,
    0x80,
    0x03,
    0x0E,
    0x03,
    0x00,
    0x00,
    0x00,
    0x80,
    0x80,
    0x03,
    0x0E,
    0x02,
    0x00,
    0x00,
    0x00,
    0x00,
    0x81,
    0x03,
    0x0E,
    0x04,
    0xFE,
    0xFF,
    0xFF,
    0x03,
    0x82,
    0x03,
    0x0E,
    0x08,
    0x02,
    0x00,
    0x00,
    0x04,
    0x82,
    0x03,
    0x0E,
    0x10,
    0x04,
    0x00,
    0x00,
    0x08,
    0x82,
    0x03,
    0x0E,
    0x20,
    0x08,
    0x00,
    0x00,
    0x10,
    0x82,
    0x03,
    0x0E,
    0x40,
    0x10,
    0x00,
    0x00,
    0x20,
    0x82,
    0x03,
    0x0E,
    0x80,
    0x20,
    0x00,
    0x00,
    0x20,
    0x82,
    0x03,
    0x0E,
    0x00,
    0x41,
    0x00,
    0x00,
    0x20,
    0x82,
    0x03,
    0x0E,
    0x00,
    0x82,
    0x00,
    0x00,
    0x20,
    0x82,
    0x03,
    0x0E,
    0x00,
    0x44,
    0x00,
    0x00,
    0x20,
    0x82,
    0x03,
    0x0E,
    0x00,
    0x28,
    0x00,
    0x00,
    0x20,
    0x82,
    0x03,
    0x0E,
    0x00,
    0x10,
    0x00,
    0x00,
    0x20,
    0x82,
    0x03,
    0x0E,
    0x00,
    0x00,
    0x00,
    0x00,
    0x20,
    0x82,
    0x03,
    0x0E,
    0x00,
    0x00,
    0x00,
    0x00,
    0x20,
    0x82,
    0x03,
    0x0E,
    0x00,
    0x00,
    0x00,
    0x00,
    0x20,
    0x82,
    0x03,
    0x0E,
    0x00,
    0x00,
    0x00,
    0x00,
    0x20,
    0x82,
    0x03,
    0x0E,
    0x00,
    0x00,
    0x00,
    0x00,
    0x20,
    0x82,
    0x03,
    0x0E,
    0x00,
    0x00,
    0x00,
    0x00,
    0x10,
    0x82,
    0x03,
    0x0E,
    0x00,
    0x00,
    0x00,
    0x00,
    0x08,
    0x82,
    0x03,
    0x0E,
    0x00,
    0x00,
    0x00,
    0x00,
    0x04,
    0x82,
    0x03,
    0x0E,
    0xC0,
    0xFF,
    0xFF,
    0xFF,
    0x03,
    0x82,
    0x03,
    0x0E,
    0x40,
    0x00,
    0x00,
    0x00,
    0x00,
    0x81,
    0x03,
    0x0E,
    0x40,
    0x00,
    0x00,
    0x00,
    0x80,
    0x80,
    0x03,
    0x0E,
    0x40,
    0x00,
    0x00,
    0x00,
    0x40,
    0x80,
    0x03,
    0x0E,
    0xC0,
    0xFF,
    0xFF,
    0xFF,
    0x3F,
    0x80,
    0x03,
    0x0E,
    0x00,
    0x00,
    0x00,
    0x00,
    0x00,
    0x80,
    0x03,
    0x0E,
    0x00,
    0x00,
    0x00,
    0x00,
    0x00,
    0x80,
    0x03,
    0x0E,
    0x00,
    0x00,
    0x00,
    0x00,
    0x00,
    0x80,
    0x03,
    0x0E,
    0x00,
    0x00,
    0x00,
    0x00,
    0x00,
    0x80,
    0x03,
    0x0E,
    0x00,
    0x00,
    0x00,
    0x00,
    0x00,
    0x80,
    0x03,
    0x0E,
    0x00,
    0x00,
    0x00,
    0x00,
    0x00,
    0x80,
    0x03,
    0x0E,
    0x00,
    0x00,
    0x00,
    0x00,
    0x00,
    0x80,
    0x03,
    0x0C,
    0x00,
    0x00,
    0x00,
    0x00,
    0x00,
    0x80,
    0x01,
    0xF8,
    0xFF,
    0xFF,
    0xFF,
    0xFF,
    0xFF,
    0xFF,
    0x00,
    0xF0,
    0xFF,
    0xFF,
    0xFF,
    0xFF,
    0xFF,
    0x7F,
    0x00,
    0xE0,
    0xFF,
    0xFF,
    0xFF,
    0xFF,
    0xFF,
    0x3F,
    0x00,
    0x00,
    0x00,
    0x00,
    0x00,
    0x00,
    0x00,
    0x00,
    0x00};

const unsigned char LV[] U8X8_PROGMEM = { // 率
    0x40, 0x00, 0x80, 0x00, 0xFE, 0x3F, 0x40, 0x00, 0x22, 0x22, 0xF4, 0x11, 0x88, 0x08, 0x44, 0x12,
    0xF2, 0x27, 0x00, 0x04, 0x80, 0x00, 0xFF, 0x7F, 0x80, 0x00, 0x80, 0x00, 0x80, 0x00, 0x80, 0x00};
const unsigned char KAI[] U8X8_PROGMEM = {0x00, 0x00, 0xFE, 0x3F, 0x10, 0x04, 0x10, 0x04, 0x10, 0x04, 0x10, 0x04, 0x10, 0x04, 0xFF, 0x7F,
                                          0x10, 0x04, 0x10, 0x04, 0x10, 0x04, 0x10, 0x04, 0x08, 0x04, 0x08, 0x04, 0x04, 0x04, 0x02, 0x04};
/* (16 X 16 , 宋体 )*/
const unsigned char QI[] U8X8_PROGMEM = {
    0x80, 0x00, 0x00, 0x01, 0xF8, 0x3F, 0x08, 0x20, 0x08, 0x20, 0x08, 0x20, 0xF8, 0x3F, 0x08, 0x00,
    0x08, 0x00, 0x08, 0x00, 0xE8, 0x3F, 0x24, 0x20, 0x24, 0x20, 0x22, 0x20, 0xE1, 0x3F, 0x20, 0x20};

const unsigned char MIE[] U8X8_PROGMEM = {
    0x00,
    0x00,
    0xFF,
    0x7F,
    0x80,
    0x00,
    0x80,
    0x00,
    0x88,
    0x10,
    0x88,
    0x10,
    0x88,
    0x08,
    0x84,
    0x04,
    0x42,
    0x01,
    0x40,
    0x01,
    0x20,
    0x02,
    0x20,
    0x02,
    0x10,
    0x04,
    0x08,
    0x08,
    0x04,
    0x10,
    0x03,
    0x60,
};
const unsigned char KUANG[] U8X8_PROGMEM = {
    //  框
    0X00,
    0X00,
    0X00,
    0X00,
    0X00,
    0X3C,
    0X00,
    0X00,
    0XE0,
    0X01,
    0X04,
    0X00,
    0X00,
    0X00,
    0X01,
    0X04,
    0X00,
    0X00,
    0X00,
    0X01,
    0X04,
    0X00,
    0X00,
    0X00,
    0X01,
    0X00,
    0X00,
    0X00,
    0X00,
    0X00,
    0X00,
    0X00,
    0X00,
    0X00,
    0X00,
    0X00,
    0X00,
    0X00,
    0X00,
    0X00,
    0X00,
    0X00,
    0X00,
    0X00,
    0X00,
    0X00,
    0X00,
    0X00,
    0X00,
    0X00,
    0X00,
    0X00,
    0X00,
    0X00,
    0X00,
    0X04,
    0X00,
    0X00,
    0X00,
    0X01,
    0X04,
    0X00,
    0X00,
    0X00,
    0X01,
    0X04,
    0X00,
    0X00,
    0X00,
    0X01,
    0X3C,
    0X00,
    0X00,
    0XE0,
    0X01,
    0X00,
    0X00,
    0X00,
    0X00,
    0X00,
};
//******************************************图标****************************************************//

//******************************************TEXT****************************************************//
SETTING_LIST oled_list[] = {
    {"屏幕亮度", 4, OLED_Light},
    {"自动息屏", 4, OLED_XP},
    {"息屏时间", 4, OLED_Seconds},
    {"返回菜单", 4, NULL},
};

SETTING_LIST ir_list[] = {
    {"指示灯模式", 5, IR_Location_light},
    {"连续扫描", 4, IR_Coiled},
    {"扫描次数", 4, IR_C_time},
    {"返回菜单", 4, NULL},
};

SETTING_LIST rfid_list[] = {
    {"指示灯模式", 5, RFID_Location_light},
    {"连续扫描", 4, RFID_Coiled},
    {"扫描次数", 4, RFID_C_time},
    {"发送功", 4, RFID_Power},
    {"返回菜单", 4, NULL},
};

SETTING_LIST cam_list[] = {
    // {"定位灯模式", 5, CAM_Location_light},
    // {"补光灯模式", 5, CAM_Fill_light},
    {"连续扫描", 4, CAM_Coiled},
    {"扫描次数", 4, CAM_C_time},
    {"返回菜单", 4, NULL},
};

SETTING_LIST sys_list[] = {
    {"Reboot", 6, NULL},
    {"软件版本", 4, NULL},
    {"返回菜单", 4, NULL},
};

//******************************************TEXT****************************************************//
int ui_run(short *a, short *a_trg, uint8_t step, uint8_t slow_cnt)
{
    uint8_t temp;

    temp = abs(*a_trg - *a) > slow_cnt ? step : 1;
    if (*a < *a_trg)
    {
        *a += temp;
    }
    else if (*a > *a_trg)
    {
        *a -= temp;
    }
    else
    {
        return 0;
    }
    return 1;
}
short setting_x = 0, setting_x_trg = 32; // 设置界面x 和设置界面x目标
short setting_y = 4, setting_y_trg = 4;  // 设置界面y 和设置界面y目标
void power_charge(int charging)          // 充电动画
{
    switch (charging)
    {
    case 0:
        u8g2.drawXBM(barrier_X, barrier_Y, 24, 16, better_0);
        break;
    case 1:
        u8g2.drawXBM(barrier_X, barrier_Y, 24, 16, better_25);
        break;
    case 2:
        u8g2.drawXBM(barrier_X, barrier_Y, 24, 16, better_50);
        break;
    case 3:
        u8g2.drawXBM(barrier_X, barrier_Y, 24, 16, better_75);
        break;
    case 4:
        u8g2.drawXBM(barrier_X, barrier_Y, 24, 16, better_100);
        break;
    }
    vTaskDelay(100 / portTICK_PERIOD_MS);
}
int charging = -1;
int power_v_last = 0;
void message_bar(void)
{
    ////////////////////////////////////////电量显示///////////////////////////////////////////////////
    // 2295 2606;
    int v = analogRead(BAT_ADC);
    // u8g2.setCursor(90, 30);
    // u8g2.print((float)v / 4095 * 6.6);

    // int power_v = 2606 - v;
    int power_v = 100;
    if (power_v_num == 0)
    {
        for (int i = 119; i >= 0; i--)
        {
            power_v_lb[i] = power_v;
        }
        power_v_num = 1;
    }
    for (int i = 118; i >= 1; i--)
    {
        power_v_lb[i] = power_v_lb[i - 1];
        power_v_lb[119] += power_v_lb[i];
    }
    power_v_lb[0] = power_v;
    power_v_lb[119] += power_v;
    power_v_lb[119] = power_v_lb[119] / 119;
    // printf("%d\n", 2606-power_v_lb[119]);
    //  bleKeyboard.print("ADC:");
    // bleKeyboard.print(power_v_lb[119]);

    // char str[50];
    // sprintf(str, "%d", power_v_lb[119]);
    // char *newValue = str;
    // pCharacteristic->setValue(newValue);
    // pCharacteristic->notify();

    // if((power_v_lb[119] - power_v_last)<=0)
    // {
    //     charging = -1;
    // }
    // power_v_last = power_v_lb[119] ;

    if (charging == -1)
    {
        if (power_v_lb[119] <= 0)
        {
            u8g2.drawXBM(barrier_X, barrier_Y, 24, 16, better_100);
        }
        else if (power_v_lb[119] >= 300)
        {
            // u8g2.drawXBM(barrier_X, barrier_Y, 24, 16, better_100);
            u8g2.drawXBM(barrier_X, barrier_Y, 24, 16, better_0);
            if (power_v_lb[119] >= 310)
            {
                digitalWrite(MCU_BEEP, HIGH);
                vTaskDelay(300 / portTICK_PERIOD_MS);
                digitalWrite(MCU_BEEP, LOW);
                vTaskDelay(300 / portTICK_PERIOD_MS);
                digitalWrite(MCU_BEEP, HIGH);
                vTaskDelay(300 / portTICK_PERIOD_MS);
                digitalWrite(MCU_BEEP, LOW);
                vTaskDelay(300 / portTICK_PERIOD_MS);
                digitalWrite(MCU_BEEP, HIGH);
                vTaskDelay(300 / portTICK_PERIOD_MS);
                digitalWrite(MCU_BEEP, LOW);
                digitalWrite(MCU_BEEP, HIGH);
                vTaskDelay(2000 / portTICK_PERIOD_MS);
                digitalWrite(MCU_BEEP, LOW);
                esp_deep_sleep_start();
            }
        }
        else
        {
            power_v = (350 - power_v_lb[119]) / 3;

            if (power_v > 80)
            {
                u8g2.drawXBM(barrier_X, barrier_Y, 24, 16, better_100); // 300
            }
            else if (power_v > 65)
            {
                u8g2.drawXBM(barrier_X, barrier_Y, 24, 16, better_75); // 225
            }
            else if (power_v > 40)
            {
                u8g2.drawXBM(barrier_X, barrier_Y, 24, 16, better_50); // 150
            }
            else if (power_v > 15)
            {
                u8g2.drawXBM(barrier_X, barrier_Y, 24, 16, better_25); // 75
            }
            else if (power_v > 0)
            {
                u8g2.drawXBM(barrier_X, barrier_Y, 24, 16, better_0);
            }
        }
    }
    else if (charging > -1)
    {
        power_charge(charging);
        if (++charging > 4)
        {
            charging = 0;
        }
    }

    ////////////////////////////////////////电量显示///////////////////////////////////////////////////

    ////////////////////////////////////////蓝牙显示///////////////////////////////////////////////////
    // Bluetooth_Check();
    if (bleKeyboard.isConnected())
    {
        u8g2.drawXBM(Bluetooth_X, Bluetooth_Y, 24, 16, BLue);
    }
    else
    {
        u8g2.drawXBM(Bluetooth_X, Bluetooth_Y, 24, 16, None);
    }
    ////////////////////////////////////////蓝牙显示///////////////////////////////////////////////////

    ////////////////////////////////////////GPS显示///////////////////////////////////////////////////
    if (RMC_DATA.location_stauts == 1)
    {
        u8g2.drawXBM(GPS_X, GPS_Y, 24, 16, GPS);
    }
    else
    {
        u8g2.drawXBM(GPS_X, GPS_Y, 24, 16, None);
    }

    ////////////////////////////////////////GPS显示///////////////////////////////////////////////////

    ////////////////////////////////////////模式显示///////////////////////////////////////////////////
    u8g2.setFont(u8g2_font_wqy12_t_chinese2);
    u8g2.drawXBM(Mode_X - 7, 2, 36, 16, KUANG);
    if (scan_mode == 0)
    {
        u8g2.drawUTF8(Mode_X, Mode_Y, "红外");
        // u8g2.drawUTF8(Mode_X, Mode_Y, "1");
    }
    else if (scan_mode == 1)
    {
        u8g2.drawUTF8(Mode_X, Mode_Y, "感应");
        // u8g2.drawUTF8(Mode_X, Mode_Y, "2");
    }
    else if (scan_mode == 2)
    {
        u8g2.drawUTF8(Mode_X, Mode_Y, "扫码");
        // u8g2.drawUTF8(Mode_X, Mode_Y, "3");
    }

    ////////////////////////////////////////模式显示///////////////////////////////////////////////////
}
void Menu_Init(xMenu_Item *Menu_Item, uint8_t Menu_Num, void (*Menu_Title)(void), void (*Menu_Function)(void), xMenu_Item *Menu_Previous_Menu, xMenu_Item *Menu_Next_Menu)
{
    Menu_Item->Menu_Num = Menu_Num;
    Menu_Item->Menu_Title = Menu_Title;
    Menu_Item->Menu_Function = Menu_Function;
    Menu_Item->Previous_Menu = Menu_Previous_Menu;
    Menu_Item->Next_Menu = Menu_Next_Menu;
}
void Menu_Title(void) // 菜单不需要刷新的部分只显示一次就可以了 比如标题
{
    Runing_Menu.Menu_Item->Menu_Title();
}

void Menu_Function(void) // 菜单需要一直刷新的部分 比如变化的数据
{
    Runing_Menu.Menu_Item->Menu_Function();
}

void OLED_Init(void)
{
    // EEPROM.begin(4096);

    // EEPROM.read(0x1000);
    pinMode(MCU_OLED, OUTPUT); // OLED 电源引脚初始化
    pinMode(MCU_BEEP, OUTPUT);
    digitalWrite(MCU_OLED, HIGH);      // 电压使能
    pinMode(TRIG_KEY, INPUT_PULLDOWN); // OLED 扫码引脚初始化
    pinMode(KEY_ADC, INPUT_PULLUP);
    u8g2.setFont(u8g2_font_unifont_t_chinese3);
    u8g2.begin();
    u8g2.enableUTF8Print();
    u8g2.clearBuffer();
    u8g2.drawXBM(4, 16, 122, 32, start_ui); // 开机显示
    u8g2.sendBuffer();
    vTaskDelay(1000 / portTICK_PERIOD_MS);
    u8g2.setContrast(255);
    Menu_Init(&Main_Menu, 0, &Main_Menu_Title, &Main_Menu_Function, NULL, NULL);
    Menu_Init(&OLED_Menu, 1, &OLED_Menu_Title, &OLED_Menu_Function, NULL, NULL);
    Menu_Init(&IR_Menu, 1, &IR_Menu_Title, &IR_Menu_Function, NULL, NULL);
    Menu_Init(&RFID_Menu, 1, &RFID_Menu_Title, &RFID_Menu_Function, NULL, NULL);
    Menu_Init(&CAM_Menu, 1, &CAM_Menu_Title, &CAM_Menu_Function, NULL, NULL);
    Menu_Init(&SYS_Menu, 1, &SYS_Menu_Title, &SYS_Menu_Function, NULL, NULL);
    Runing_Menu.Menu_Item = &Main_Menu;
    Menu_Title();

    flash_init();
}

void Main_Menu_Title(void)
{
    u8g2.clear();
    if (menu_flag == 0)
    {
        setting_y = 68;
        setting_y_trg = 68;
        setting_x = 0;
        setting_x_trg = 32;
    }
    else
    {
        setting_y_trg = 4;
    }
}

void Main_Menu_Function(void)
{
    u8g2.clearBuffer();                    // 清空缓冲区
    if (menu_flag == 0 && setting_y == 68) // 判断是否菜单是否完全拉起
    {
        char str[100];
        message_bar(); // 未拉起 显示 数据 与通知栏
        u8g2.setFont(u8g2_font_unifont_t_chinese3);
        u8g2.drawStr(0, 30, scan_data_1); // 使用print来显示字符串
        u8g2.drawStr(0, 45, scan_data_2); // 使用print来显示字符串
        // sprintf(str, "%.6f,%.6f",RMC_DATA.latitude, RMC_DATA.longitude);
        if (RMC_DATA.tital != 0)
        {
            sprintf(str, "%.0f,%d", RMC_DATA.beijing_time, RMC_DATA.tital);
        }
        u8g2.drawUTF8(0, 60, str);
        u8g2.sendBuffer();
    }
    u8g2.drawXBM(setting_x - 80, setting_y, 64, 64, RETURN);
    u8g2.drawXBM(setting_x, setting_y, 64, 64, OLED);
    u8g2.drawXBM(setting_x + 80, setting_y, 64, 64, IR);
    u8g2.drawXBM(setting_x + 160, setting_y, 64, 64, RFID);
    u8g2.drawXBM(setting_x + 240, setting_y, 64, 64, CAM);
    u8g2.drawXBM(setting_x + 320, setting_y, 64, 64, SYS);
    u8g2.drawXBM(setting_x + 400, setting_y, 64, 64, RETURN);

    ui_run(&setting_x, &setting_x_trg, 16, 0);
    ui_run(&setting_y, &setting_y_trg, 16, 0);
    u8g2.sendBuffer();
    if (key_value == 1)
    {
        key_value = 0;
        if (menu_flag == 0)
        {
            menu_flag = 1;
            setting_y_trg = 4;
            setting_x = 32;
            setting_x_trg = 32;
        }
        else
        {
            switch (menu_select)
            {
            case -5: // 挂起菜单选项
                menu_select = 0;
                menu_flag = 0;
                setting_y_trg = 68;
                break;
            case -4:
                Runing_Menu.Menu_Item = &SYS_Menu;
                setting_y_trg = -60;
                while (ui_run(&setting_y, &setting_y_trg, 8, 0))
                {
                    u8g2.clearBuffer();
                    u8g2.drawXBM(setting_x, setting_y, 64, 64, SYS);
                    u8g2.sendBuffer();
                    vTaskDelay(1 / portTICK_PERIOD_MS);
                }
                SYS_Menu_Title();
                break;
            case -3:
                Runing_Menu.Menu_Item = &CAM_Menu;
                setting_y_trg = -60;
                while (ui_run(&setting_y, &setting_y_trg, 8, 0))
                {
                    u8g2.clearBuffer();
                    u8g2.drawXBM(setting_x, setting_y, 64, 64, CAM);
                    u8g2.sendBuffer();
                    vTaskDelay(1 / portTICK_PERIOD_MS);
                }
                CAM_Menu_Title();
                break;
            case -2:
                Runing_Menu.Menu_Item = &RFID_Menu;
                setting_y_trg = -60;
                while (ui_run(&setting_y, &setting_y_trg, 8, 0))
                {
                    u8g2.clearBuffer();
                    u8g2.drawXBM(setting_x, setting_y, 64, 64, RFID);
                    u8g2.sendBuffer();
                    vTaskDelay(1 / portTICK_PERIOD_MS);
                }
                RFID_Menu_Title();
                break;
            case -1:
                Runing_Menu.Menu_Item = &IR_Menu;
                setting_y_trg = -60;
                while (ui_run(&setting_y, &setting_y_trg, 8, 0))
                {
                    u8g2.clearBuffer();
                    u8g2.drawXBM(setting_x, setting_y, 64, 64, IR);
                    u8g2.sendBuffer();
                    vTaskDelay(1 / portTICK_PERIOD_MS);
                }
                IR_Menu_Title();
                break;
            case 0:
                Runing_Menu.Menu_Item = &OLED_Menu;
                setting_y_trg = -60;
                while (ui_run(&setting_y, &setting_y_trg, 8, 0))
                {
                    u8g2.clearBuffer();
                    u8g2.drawXBM(setting_x, setting_y, 64, 64, OLED);
                    u8g2.sendBuffer();
                    vTaskDelay(1 / portTICK_PERIOD_MS);
                }
                OLED_Menu_Title();
                break;
            case 1: // 挂起菜单选项
                menu_select = 0;
                menu_flag = 0;
                setting_y_trg = 68;
                break;
            }
        }
    }
    else if (key_value == 2)
    {
        key_value = 0;
        if (menu_flag == 1)
        {
            menu_select--;
            if (menu_select <= -5)
            {
                menu_select = -5;
            }
            setting_x_trg = menu_select * 80 + 32;
        }
    }
    else if (key_value == 3)
    {
        key_value = 0;
        if (menu_flag == 1)
        {
            menu_select++;
            if (menu_select >= 1)
            {
                menu_select = 1;
            }
            setting_x_trg = menu_select * 80 + 32;
        }
    }
}

void OLED_Menu_Title(void)
{
    OLED_Line = 0;
    select_staute = 0;
    ui_select = 0;
    top_bottom = 0;
    text_x_trg = 0;
    text_y_trg = 0;
    frame_y_trg = 0;
    text_line = 0;
    frame_line = 0;
    frame_len = frame_len_trg = oled_list[ui_select].len * 16 + 2;
}
void OLED_Menu_Function(void)
{
    u8g2.setFont(u8g2_font_unifont_t_chinese3);
    int list_len = sizeof(oled_list) / sizeof(SETTING_LIST);
    u8g2.clearBuffer(); // 清除内部缓冲区
    for (int i = 0; i < list_len; i++)
    {
        u8g2.drawUTF8(x + 2 + text_x, y + i * 20 + text_y, oled_list[i].str); // 第一段输出位置
        if (i == 0)
        {
            u8g2.setCursor(x + 80 + text_x, y + i * 20 + text_y);
            u8g2.print(oled_list[i].data);
        }
        else if (i == 1)
        {
            if (oled_list[i].data == 1)
            {
                u8g2.drawUTF8(x + 82 + text_x, 18 + i * 20 + text_y, "开");
                u8g2.drawXBM(x + 82 + text_x + 16, 4 + i * 20 + text_y, 16, 16, QI);
            }
            else if (oled_list[i].data == 0)
            {
                u8g2.drawUTF8(x + 82 + text_x, 20 + i * 18 + text_y, "关闭");
            }
        }
        else if (i == 2)
        {
            u8g2.setCursor(x + 80 + text_x, y + i * 20 + text_y);
            u8g2.print(oled_list[i].data);
        }
    }
    u8g2.drawRFrame(x, frame_y, frame_len, 22, 3);
    ui_run(&text_x, &text_x_trg, 8, 4);
    ui_run(&text_y, &text_y_trg, 20, 5);
    ui_run(&frame_y, &frame_y_trg, 8, 4);
    ui_run(&frame_len, &frame_len_trg, 16, 5);
    u8g2.sendBuffer();
    if (select_staute == 0)
    {
        switch (key_value)
        {
        case 1:
            key_value = 0;
            switch (ui_select)
            {
            case 0:
                select_staute = 1;
                break;
            case 1:
                select_staute = 1;
                break;
            case 2:
                select_staute = 1;
                break;
            case 3:
                setting_y_trg = 4;
                Runing_Menu.Menu_Item = &Main_Menu;
                Menu_Title();
                break;
            }
            break;
        case 2:
            key_value = 0;
            if (frame_line == 2)
            {
                top_bottom = 1;
            }
            else if (frame_line == 0)
            {
                top_bottom = 0;
            }
            if (top_bottom == 0)
            {
                frame_line++;
            }
            else if (top_bottom == 1 && ui_select < list_len - 1)
            {
                text_line--;
            }
            if (++ui_select > list_len - 1)
            {
                ui_select = list_len - 1;
            }
            break;
        case 3:
            key_value = 0;
            if (frame_line == 0)
            {
                top_bottom = 2;
            }
            else if (frame_line == 2)
            {
                top_bottom = 0;
            }
            if (top_bottom == 2 && ui_select > 0)
            {
                text_line++;
            }
            else if (top_bottom == 0)
            {
                frame_line--;
            }
            if (--ui_select < 0)
            {
                ui_select = 0;
                text_line = 0;
            }
            break;
        }
        text_y_trg = text_line * 20;
        frame_y_trg = frame_line * 20;
        frame_len_trg = oled_list[ui_select].len * 16 + 2;
    }
    else
    {
        switch (key_value)
        {
        case 1:
            key_value = 0;
            switch (ui_select)
            {
            case 0:
                select_staute = 0;
                prefs.begin("data_space");
                prefs.putInt("OLED_Light", oled_list[0].data);
                prefs.end();
                break;
            case 1:
                select_staute = 0;
                prefs.begin("data_space");
                prefs.putInt("OLED_XP", oled_list[1].data);
                prefs.end();
            case 2:
                select_staute = 0;
                prefs.begin("data_space");
                prefs.putInt("OLED_Seconds", oled_list[2].data);
                prefs.end();
                break;
            }
            break;
        case 2:
            key_value = 0;
            switch (ui_select)
            {
            case 0:
                oled_list[ui_select].data += 5;
                if (oled_list[ui_select].data > 255)
                {
                    oled_list[ui_select].data = 255;
                }
                u8g2.setContrast(oled_list[ui_select].data);
                break;
            case 1:
                oled_list[ui_select].data += 1;
                if (oled_list[ui_select].data > 1)
                {
                    oled_list[ui_select].data = 1;
                }
                break;
            case 2:
                oled_list[ui_select].data += 1;
                if (oled_list[ui_select].data > 60)
                {
                    oled_list[ui_select].data = 60;
                }
                break;
            }
            break;
        case 3:
            key_value = 0;
            switch (ui_select)
            {
            case 0:
                oled_list[ui_select].data -= 5;
                if (oled_list[ui_select].data < 5)
                {
                    oled_list[ui_select].data = 5;
                }
                u8g2.setContrast(oled_list[ui_select].data);
                break;
            case 1:
                oled_list[ui_select].data -= 1;
                if (oled_list[ui_select].data < 0)
                {
                    oled_list[ui_select].data = 0;
                }
                break;
            case 2:
                oled_list[ui_select].data -= 1;
                if (oled_list[ui_select].data < 5)
                {
                    oled_list[ui_select].data = 5;
                }
                break;
            }
            break;
        }
        frame_len_trg = 128;
    }
}

void IR_Menu_Title(void)
{
    OLED_Line = 0;
    select_staute = 0;
    ui_select = 0;
    top_bottom = 0;
    text_x_trg = 0;
    text_y_trg = 0;
    frame_y_trg = 0;
    text_line = 0;
    frame_line = 0;
    frame_len = frame_len_trg = ir_list[ui_select].len * 16 + 2;
}
void IR_Menu_Function(void)
{
    u8g2.setFont(u8g2_font_unifont_t_chinese3);
    int list_len = sizeof(ir_list) / sizeof(SETTING_LIST);
    u8g2.clearBuffer(); // 清除内部缓冲区
    for (int i = 0; i < list_len; i++)
    {
        u8g2.drawUTF8(x + 2 + text_x, y + i * 20 + text_y, ir_list[i].str); // 第一段输出位置
        if (i == 0)
        {
            if (ir_list[i].data == 0)
            {
                u8g2.drawUTF8(x + 96 + text_x, 18 + i * 20 + text_y, "伴随");
            }
            else if (ir_list[i].data == 1)
            {
                u8g2.drawUTF8(x + 96 + text_x, 18 + i * 20 + text_y, "常亮");
            }
            else if (ir_list[i].data == 2)
            {
                u8g2.drawUTF8(x + 96 + text_x, 18 + i * 20 + text_y, "常");
                u8g2.drawXBM(x + 96 + text_x + 16, 4 + i * 20 + text_y, 16, 16, MIE);
            }
        }
        else if (i == 1)
        {
            if (ir_list[i].data == 1)
            {
                u8g2.drawUTF8(x + 96 + text_x, 18 + i * 20 + text_y, "开");
                u8g2.drawXBM(x + 96 + text_x + 16, 4 + i * 20 + text_y, 16, 16, QI);
            }
            else if (ir_list[i].data == 0)
            {
                u8g2.drawUTF8(x + 96 + text_x, 20 + i * 18 + text_y, "关闭");
            }
        }
        else if (i == 2)
        {
            u8g2.setCursor(x + 112, text_y + y + i * 20);
            u8g2.print(ir_list[i].data);
        }
    }
    u8g2.drawRFrame(x, frame_y, frame_len, 22, 3);

    ui_run(&text_x, &text_x_trg, 8, 4);
    ui_run(&text_y, &text_y_trg, 20, 5);
    ui_run(&frame_y, &frame_y_trg, 8, 4);
    ui_run(&frame_len, &frame_len_trg, 16, 5);

    // u8g2.setCursor(x + 100, 48);
    // u8g2.print(ui_select);
    // u8g2.setCursor(x + 120, 48);
    // u8g2.print(top_bottom);
    u8g2.sendBuffer();
    if (select_staute == 0)
    {
        switch (key_value)
        {
        case 1:
            key_value = 0;
            switch (ui_select)
            {
            case 0:
                select_staute = 1;
                break;
            case 1:
                select_staute = 1;
                break;
            case 2:
                select_staute = 1;
                break;
            case 3:
                setting_y_trg = 4;
                Runing_Menu.Menu_Item = &Main_Menu;
                Menu_Title();
                break;
            }
            break;
        case 2:
            key_value = 0;
            if (frame_line == 2)
            {
                top_bottom = 1;
            }
            else if (frame_line == 0)
            {
                top_bottom = 0;
            }
            if (top_bottom == 0)
            {
                frame_line++;
            }
            else if (top_bottom == 1 && ui_select < list_len - 1)
            {
                text_line--;
            }
            if (++ui_select > list_len - 1)
            {
                ui_select = list_len - 1;
            }
            break;
        case 3:
            key_value = 0;
            if (frame_line == 0)
            {
                top_bottom = 2;
            }
            else if (frame_line == 2)
            {
                top_bottom = 0;
            }
            if (top_bottom == 2 && ui_select > 0)
            {
                text_line++;
            }
            else if (top_bottom == 0)
            {
                frame_line--;
            }
            if (--ui_select < 0)
            {
                ui_select = 0;
                text_line = 0;
            }
            break;
        }
        text_y_trg = text_line * 20;
        frame_y_trg = frame_line * 20;
        frame_len_trg = ir_list[ui_select].len * 16 + 2;
    }
    else
    {
        switch (key_value)
        {
        case 1:
            key_value = 0;
            switch (ui_select)
            {
            case 0:
                select_staute = 0;
                prefs.begin("data_space");
                prefs.putInt("IR_L_light", ir_list[0].data);
                prefs.end();
                break;
            case 1:
                select_staute = 0;
                prefs.begin("data_space");
                prefs.putInt("IR_Coiled", ir_list[1].data);
                prefs.end();
                break;
            case 2:
                select_staute = 0;
                prefs.begin("data_space");
                prefs.putInt("IR_C_time", ir_list[2].data);
                prefs.end();
            }
            break;
        case 2:
            key_value = 0;
            switch (ui_select)
            {
            case 0:
                ir_list[ui_select].data += 1;
                if (ir_list[ui_select].data > 2)
                {
                    ir_list[ui_select].data = 0;
                }
                break;
            case 1:
                ir_list[ui_select].data += 1;
                if (ir_list[ui_select].data > 1)
                {
                    ir_list[ui_select].data = 1;
                }
                break;
            case 2:
                ir_list[ui_select].data += 1;
                if (ir_list[ui_select].data > 15)
                {
                    ir_list[ui_select].data = 15;
                }
                break;
            }
            break;
        case 3:
            key_value = 0;
            switch (ui_select)
            {
            case 0:
                ir_list[ui_select].data -= 1;
                if (ir_list[ui_select].data < 0)
                {
                    ir_list[ui_select].data = 2;
                }
                break;
            case 1:
                ir_list[ui_select].data -= 1;
                if (ir_list[ui_select].data < 0)
                {
                    ir_list[ui_select].data = 0;
                }
                break;
            case 2:
                ir_list[ui_select].data -= 1;
                if (ir_list[ui_select].data < 3)
                {
                    ir_list[ui_select].data = 3;
                }
                break;
            }
            break;
        }

        frame_len_trg = 128;
    }
}

void RFID_Menu_Title(void)
{
    OLED_Line = 0;
    select_staute = 0;
    ui_select = 0;
    top_bottom = 0;
    text_x_trg = 0;
    text_y_trg = 0;
    frame_y_trg = 0;
    text_line = 0;
    frame_line = 0;
    frame_len = frame_len_trg = rfid_list[ui_select].len * 16 + 2;
}
void RFID_Menu_Function(void)
{
    u8g2.setFont(u8g2_font_unifont_t_chinese3);
    int list_len = sizeof(rfid_list) / sizeof(SETTING_LIST);
    u8g2.clearBuffer(); // 清除内部缓冲区
    for (int i = 0; i < list_len; i++)
    {
        u8g2.drawUTF8(x + 2 + text_x, y + i * 20 + text_y, rfid_list[i].str); // 第一段输出位置
        if (i == 3)
        {
            u8g2.drawXBM(x + 50 + text_x, 4 + i * 20 + text_y, 16, 16, LV);
        }
        if (i == 0)
        {
            if (rfid_list[i].data == 0)
            {
                u8g2.drawUTF8(x + 96 + text_x, 18 + i * 20 + text_y, "伴随");
            }
            else if (rfid_list[i].data == 1)
            {
                u8g2.drawUTF8(x + 96 + text_x, 18 + i * 20 + text_y, "常亮");
            }
            else if (rfid_list[i].data == 2)
            {
                u8g2.drawUTF8(x + 96 + text_x, 18 + i * 20 + text_y, "常");
                u8g2.drawXBM(x + 96 + text_x + 16, 4 + i * 20 + text_y, 16, 16, MIE);
            }
        }
        else if (i == 1)
        {
            if (rfid_list[i].data == 1)
            {
                u8g2.drawUTF8(x + 96 + text_x, 18 + i * 20 + text_y, "开");
                u8g2.drawXBM(x + 96 + text_x + 16, 4 + i * 20 + text_y, 16, 16, QI);
            }
            else if (rfid_list[i].data == 0)
            {
                u8g2.drawUTF8(x + 96 + text_x, 20 + i * 18 + text_y, "关闭");
            }
        }
        else if (i == 2 || i == 3)
        {
            u8g2.setCursor(x + 112, text_y + y + i * 20);
            u8g2.print(rfid_list[i].data);
        }
    }
    u8g2.drawRFrame(x, frame_y, frame_len, 22, 3);
    ui_run(&text_x, &text_x_trg, 8, 4);
    ui_run(&text_y, &text_y_trg, 20, 5);
    ui_run(&frame_y, &frame_y_trg, 8, 4);
    ui_run(&frame_len, &frame_len_trg, 16, 5);
    u8g2.sendBuffer();
    if (select_staute == 0)
    {
        switch (key_value)
        {
        case 1:
            key_value = 0;
            switch (ui_select)
            {
            case 0:
                select_staute = 1;
                break;
            case 1:
                select_staute = 1;
                break;
            case 2:
                select_staute = 1;
                break;
            case 3:
                select_staute = 1;
                break;
            case 4:
                setting_y_trg = 4;
                Runing_Menu.Menu_Item = &Main_Menu;
                Menu_Title();
                break;
            }
            break;
        case 2:
            key_value = 0;
            if (frame_line == 2)
            {
                top_bottom = 1;
            }
            else if (frame_line == 0)
            {
                top_bottom = 0;
            }
            if (top_bottom == 0)
            {
                frame_line++;
            }
            else if (top_bottom == 1 && ui_select < list_len - 1)
            {
                text_line--;
            }
            if (++ui_select > list_len - 1)
            {
                ui_select = list_len - 1;
            }
            break;
        case 3:
            key_value = 0;
            if (frame_line == 0)
            {
                top_bottom = 2;
            }
            else if (frame_line == 2)
            {
                top_bottom = 0;
            }
            if (top_bottom == 2 && ui_select > 0)
            {
                text_line++;
            }
            else if (top_bottom == 0)
            {
                frame_line--;
            }
            if (--ui_select < 0)
            {
                ui_select = 0;
                text_line = 0;
            }
            break;
        }
        text_y_trg = text_line * 20;
        frame_y_trg = frame_line * 20;
        frame_len_trg = rfid_list[ui_select].len * 16 + 2;
    }
    else
    {
        switch (key_value)
        {
        case 1:
            key_value = 0;
            switch (ui_select)
            {
            case 0:
                select_staute = 0;
                prefs.begin("data_space");
                prefs.putInt("RFID_L_light", rfid_list[ui_select].data);
                prefs.end();
                break;
            case 1:
                select_staute = 0;
                prefs.begin("data_space");
                prefs.putInt("RFID_Coiled", rfid_list[ui_select].data);
                prefs.end();
                break;
            case 2:
                select_staute = 0;
                prefs.begin("data_space");
                prefs.putInt("RFID_C_time", rfid_list[ui_select].data);
                prefs.end();
                break;
            case 3:
                select_staute = 0;
                prefs.begin("data_space");
                prefs.putInt("RFID_Power", rfid_list[ui_select].data);
                prefs.end();
                if (rfid_list[ui_select].data <= 26 && rfid_list[ui_select].data >= 15)
                {
                    uint8_t power_high = (rfid_list[ui_select].data * 100) >> 8;
                    uint8_t power_low = (rfid_list[ui_select].data * 100) & 0xff;
                    uint8_t Ver = (0XB6 + 0X02 + power_high + power_low) & 0xff;
                    uint8_t power_set_db[9] = {0XBB, 0X00, 0XB6, 0X00, 0X02, power_high, power_low, Ver, 0X7E};
                    RFID_COMMAND(power_set_db);
                }
                break;
            }
            break;
        case 2:
            key_value = 0;
            switch (ui_select)
            {
            case 0:
                rfid_list[ui_select].data += 1;
                if (rfid_list[ui_select].data > 2)
                {
                    rfid_list[ui_select].data = 0;
                }
                break;
            case 1:
                rfid_list[ui_select].data += 1;
                if (rfid_list[ui_select].data > 1)
                {
                    rfid_list[ui_select].data = 1;
                }
                break;
            case 2:
                rfid_list[ui_select].data += 1;
                if (rfid_list[ui_select].data > 15)
                {
                    rfid_list[ui_select].data = 15;
                }
                break;
            case 3:
                rfid_list[ui_select].data += 1;
                if (rfid_list[ui_select].data > 26)
                {
                    rfid_list[ui_select].data = 26;
                }
                break;
            }
            break;
        case 3:
            key_value = 0;
            switch (ui_select)
            {
            case 0:
                rfid_list[ui_select].data -= 1;
                if (rfid_list[ui_select].data < 0)
                {
                    rfid_list[ui_select].data = 0;
                }
                break;
            case 1:
                rfid_list[ui_select].data -= 1;
                if (rfid_list[ui_select].data < 0)
                {
                    rfid_list[ui_select].data = 0;
                }
                break;
            case 2:
                rfid_list[ui_select].data -= 1;
                if (rfid_list[ui_select].data < 3)
                {
                    rfid_list[ui_select].data = 3;
                }
                break;
            case 3:
                rfid_list[ui_select].data -= 1;
                if (rfid_list[ui_select].data < 15)
                {
                    rfid_list[ui_select].data = 15;
                }
                break;
            }
            break;
        }
        frame_len_trg = 128;
    }
}
char CAM_SET_SBIT[9] = {0X7E, 0X00, 0X08, 0x01, 0x00, 0x00, 0XC1, 0XAB, 0XCD};
void CAM_Menu_Title(void)
{
    OLED_Line = 0;
    select_staute = 0;
    ui_select = 0;
    top_bottom = 0;
    text_x_trg = 0;
    text_y_trg = 0;
    frame_y_trg = 0;
    text_line = 0;
    frame_line = 0;
    frame_len = frame_len_trg = cam_list[ui_select].len * 16 + 2;
}
void CAM_Menu_Function(void)
{
    u8g2.setFont(u8g2_font_unifont_t_chinese3);
    int list_len = sizeof(cam_list) / sizeof(SETTING_LIST);
    u8g2.clearBuffer(); // 清除内部缓冲区
    for (int i = 0; i < list_len; i++)
    {
        u8g2.drawUTF8(x + 2 + text_x, y + i * 20 + text_y, cam_list[i].str); // 第一段输出位置
        // if (i == 0)
        // {
        //     if (cam_list[i].data == 0)
        //     {
        //         u8g2.drawUTF8(x + 96 + text_x, 18 + i * 20 + text_y, "伴随");
        //     }
        //     else if (cam_list[i].data == 1)
        //     {
        //         u8g2.drawUTF8(x + 96 + text_x, 18 + i * 20 + text_y, "常亮");
        //     }
        //     else if (cam_list[i].data == 2)
        //     {
        //         u8g2.drawUTF8(x + 96 + text_x, 18 + i * 20 + text_y, "常");
        //         u8g2.drawXBM(x + 96 + text_x + 16, 4 + i * 20 + text_y, 16, 16, MIE);
        //     }
        // }
        // else if (i == 1)
        // {
        //     if (cam_list[i].data == 0)
        //     {
        //         u8g2.drawUTF8(x + 96 + text_x, 18 + i * 20 + text_y, "伴随");
        //     }
        //     else if (cam_list[i].data == 1)
        //     {
        //         u8g2.drawUTF8(x + 96 + text_x, 18 + i * 20 + text_y, "常亮");
        //     }
        //     else if (cam_list[i].data == 2)
        //     {
        //         u8g2.drawUTF8(x + 96 + text_x, 18 + i * 20 + text_y, "常");
        //         u8g2.drawXBM(x + 96 + text_x + 16, 4 + i * 20 + text_y, 16, 16, MIE);
        //     }
        // }
        // else
        if (i == 0)
        {
            if (cam_list[i].data == 1)
            {
                u8g2.drawUTF8(x + 96 + text_x, 18 + i * 20 + text_y, "开");
                u8g2.drawXBM(x + 96 + text_x + 16, 4 + i * 20 + text_y, 16, 16, QI);
            }
            else if (cam_list[i].data == 0)
            {
                u8g2.drawUTF8(x + 96 + text_x, 20 + i * 18 + text_y, "关闭");
            }
        }
        else if (i == 1)
        {
            u8g2.setCursor(x + 112, text_y + y + i * 20);
            u8g2.print(cam_list[i].data);
        }
    }
    u8g2.drawRFrame(x, frame_y, frame_len, 22, 3);
    ui_run(&text_x, &text_x_trg, 8, 4);
    ui_run(&text_y, &text_y_trg, 20, 5);
    ui_run(&frame_y, &frame_y_trg, 8, 4);
    ui_run(&frame_len, &frame_len_trg, 16, 5);
    u8g2.sendBuffer();
    if (select_staute == 0)
    {
        switch (key_value)
        {
        case 1:
            key_value = 0;
            switch (ui_select)
            {
            case 0:
                select_staute = 1;
                break;
            case 1:
                select_staute = 1;
                break;
            case 2:
                setting_y_trg = 4;
                Runing_Menu.Menu_Item = &Main_Menu;
                Menu_Title();
                break;
            }
            break;
        case 2:
            key_value = 0;
            if (frame_line == 2)
            {
                top_bottom = 1;
            }
            else if (frame_line == 0)
            {
                top_bottom = 0;
            }
            if (top_bottom == 0)
            {
                frame_line++;
            }
            else if (top_bottom == 1 && ui_select < list_len - 1)
            {
                text_line--;
            }
            if (++ui_select > list_len - 1)
            {
                ui_select = list_len - 1;
            }
            break;
        case 3:
            key_value = 0;
            if (frame_line == 0)
            {
                top_bottom = 2;
            }
            else if (frame_line == 2)
            {
                top_bottom = 0;
            }
            if (top_bottom == 2 && ui_select > 0)
            {
                text_line++;
            }
            else if (top_bottom == 0)
            {
                frame_line--;
            }
            if (--ui_select < 0)
            {
                ui_select = 0;
                text_line = 0;
            }
            break;
        }
        text_y_trg = text_line * 20;
        frame_y_trg = frame_line * 20;
        frame_len_trg = cam_list[ui_select].len * 16 + 2;
    }
    else
    {
        switch (key_value)
        {
        case 1:
            key_value = 0;
            switch (ui_select)
            {
            // case 0:
            //     select_staute = 0;
            //     prefs.begin("data_space");
            //     prefs.putInt("CAM_L_light", cam_list[0].data);
            //     prefs.end();
            //     // CAM_SET_SBIT[6] &= 0XCF;
            //     // if (cam_list[0].data == 0) // 伴随 常亮 长灭
            //     // {
            //     //     CAM_SET_SBIT[6] |= (0x01 << 5);
            //     // }
            //     // else if (cam_list[0].data == 1) // 伴随 常亮 长灭
            //     // {
            //     //     CAM_SET_SBIT[6] |= (0x01 << 5);
            //     //     CAM_SET_SBIT[6] |= (0x01 << 6);
            //     // }
            //     // else if (cam_list[0].data == 2) // 伴随 常亮 长灭`
            //     // {
            //     //     CAM_SET_SBIT[6] |= (0x01 << 5);
            //     //     CAM_SET_SBIT[6] |= (0x01 << 6);
            //     // }

            //     // if (cam_list[1].data == 0) // 伴随 常亮 长灭
            //     // {
            //     //     CAM_SET_SBIT[6] |= (0x01 << 3);
            //     // }
            //     // else if (cam_list[1].data == 1) // 伴随 常亮 长灭
            //     // {
            //     //     CAM_SET_SBIT[6] |= (0x01 << 3);
            //     //     CAM_SET_SBIT[6] |= (0x01 << 4);
            //     // }
            //     // else if (cam_list[1].data == 2) // 伴随 常亮 长灭
            //     // {
            //     //     CAM_SET_SBIT[6] |= (0x01 << 3);
            //     //     CAM_SET_SBIT[6] |= (0x01 << 4);
            //     // }
            //     for (int i = 0; i < 9; i++)
            //     {
            //         UART_CAM.write(CAM_SET_SBIT[i]);
            //     }
            //     break;
            // case 1:
            //     select_staute = 0;
            //     prefs.begin("data_space");
            //     prefs.putInt("CAM_F_light", cam_list[1].data);
            //     prefs.end();
            //     // CAM_SET_SBIT[6] &= 0XF3;
            //     // if (cam_list[0].data == 0) // 伴随 常亮 长灭
            //     // {
            //     //     CAM_SET_SBIT[6] |= (0x01 << 5);
            //     // }
            //     // else if (cam_list[0].data == 1) // 伴随 常亮 长灭
            //     // {
            //     //     CAM_SET_SBIT[6] |= (0x01 << 5);
            //     //     CAM_SET_SBIT[6] |= (0x01 << 6);
            //     // }
            //     // else if (cam_list[0].data == 2) // 伴随 常亮 长灭
            //     // {
            //     //     CAM_SET_SBIT[6] |= (0x01 << 5);
            //     //     CAM_SET_SBIT[6] |= (0x01 << 6);
            //     // }

            //     // if (cam_list[1].data == 0) // 伴随 常亮 长灭
            //     // {
            //     //     CAM_SET_SBIT[6] |= (0x01 << 3);
            //     // }
            //     // else if (cam_list[1].data == 1) // 伴随 常亮 长灭
            //     // {
            //     //     CAM_SET_SBIT[6] |= (0x01 << 3);
            //     //     CAM_SET_SBIT[6] |= (0x01 << 4);
            //     // }
            //     // else if (cam_list[1].data == 2) // 伴随 常亮 长灭
            //     // {
            //     //     CAM_SET_SBIT[6] |= (0x01 << 3);
            //     //     CAM_SET_SBIT[6] |= (0x01 << 4);
            //     // }
            //     for (int i = 0; i < 9; i++)
            //     {
            //         UART_CAM.write(CAM_SET_SBIT[i]);
            //     }
            //     break;
            case 0:
                select_staute = 0;
                prefs.begin("data_space");
                prefs.putInt("CAM_Coiled", cam_list[2].data);
                prefs.end();
                break;
            case 1:
                select_staute = 0;
                prefs.begin("data_space");
                prefs.putInt("CAM_C_time", cam_list[3].data);
                prefs.end();
                break;
            }
            break;
        case 2:
            key_value = 0;
            switch (ui_select)
            {
            case 0:
                cam_list[ui_select].data += 1;
                if (cam_list[ui_select].data > 1)
                {
                    cam_list[ui_select].data = 1;
                }
                break;
            case 1:
                cam_list[ui_select].data += 1;
                if (cam_list[ui_select].data > 15)
                {
                    cam_list[ui_select].data = 15;
                }
                break;
                // case 2:
                //     cam_list[ui_select].data += 1;
                //     if (cam_list[ui_select].data > 1)
                //     {
                //         cam_list[ui_select].data = 1;
                //     }
                //     break;
                // case 3:
                //     cam_list[ui_select].data += 1;
                //     if (cam_list[ui_select].data > 15)
                //     {
                //         cam_list[ui_select].data = 15;
                //     }
                // break;
            }
            break;
        case 3:
            key_value = 0;
            switch (ui_select)
            {
            case 0:
                cam_list[ui_select].data -= 1;
                if (cam_list[ui_select].data < 0)
                {
                    cam_list[ui_select].data = 0;
                }
                break;
            case 1:
                cam_list[ui_select].data -= 1;
                if (cam_list[ui_select].data < 0)
                {
                    cam_list[ui_select].data = 0;
                }
                break;
                // case 2:
                //     cam_list[ui_select].data -= 1;
                //     if (cam_list[ui_select].data < 0)
                //     {
                //         cam_list[ui_select].data = 0;
                //     }
                //     break;
                // case 3:
                //     cam_list[ui_select].data -= 1;
                //     if (cam_list[ui_select].data < 3)
                //     {
                //         cam_list[ui_select].data = 3;
                //     }
                //     break;
            }
            break;
        }
        frame_len_trg = 128;
    }
}

void SYS_Menu_Title(void)
{
    OLED_Line = 0;
    select_staute = 0;
    ui_select = 0;
    frame_len = frame_len_trg = sys_list[ui_select].len * 16 + 2;
}
void SYS_Menu_Function(void)
{
    u8g2.setFont(u8g2_font_unifont_t_chinese3);
    int list_len = sizeof(oled_list) / sizeof(SETTING_LIST);
    u8g2.clearBuffer(); // 清除内部缓冲区
    for (int i = 0; i < list_len; i += ID1())
    {
        u8g2.drawUTF8(x + 2, y + i * 20, sys_list[i].str); // 第一段输出位置
    }
    u8g2.setCursor(x + 80, y + 1 * 20);
    u8g2.print("V1.0");
    u8g2.drawRFrame(x, frame_y, frame_len, 22, 3);
    ui_run(&frame_y, &frame_y_trg, 8, 4);
    ui_run(&frame_len, &frame_len_trg, 16, 5);
    u8g2.sendBuffer();
    if (select_staute == 0)
    {
        switch (key_value)
        {
        case 1:
            key_value = 0;
            switch (ui_select)
            {
            case 0: // 重启
                resetFunc();
                break;
            case 1:
                break;
            case 2:
                setting_y_trg = 4;
                Runing_Menu.Menu_Item = &Main_Menu;
                Menu_Title();
                break;
            }
            break;
        case 2:
            key_value = 0;
            if (++ui_select > 2)
            {
                ui_select = 2;
            }
            break;
        case 3:
            key_value = 0;
            if (--ui_select < 0)
            {
                ui_select = 0;
            }
            break;
        }
        frame_y_trg = ui_select * 20;
        frame_len_trg = sys_list[ui_select].len * 16 + 2;
    }
    else
    {
        switch (key_value)
        {
        case 1:
            key_value = 0;
            switch (ui_select)
            {
            case 0:
                select_staute = 0;
                // prefs.begin("data_space");
                // prefs.putInt("CAM_Location_light", sys_list[0].data);
                // prefs.end();
                break;
            case 1:
                select_staute = 0;
                // prefs.begin("data_space");
                // prefs.putInt("CAM_Fill_light", sys_list[1].data);
                // prefs.end();
                break;
            }
            break;
        case 2:
            key_value = 0;
            switch (ui_select)
            {
            case 0:
                // cam_list[ui_select].data += 1;
                // if (cam_list[ui_select].data > 1)
                // {
                //     cam_list[ui_select].data = 1;
                // }
                break;
            case 1:
                // cam_list[ui_select].data += 1;
                // if (cam_list[ui_select].data > 1)
                // {
                //     cam_list[ui_select].data = 1;
                // }
                break;
            }
            break;
        case 3:
            key_value = 0;
            switch (ui_select)
            {
            case 0:
                // cam_list[ui_select].data -= 1;
                // if (cam_list[ui_select].data < 0)
                // {
                //     cam_list[ui_select].data = 0;
                // }
                break;
            case 1:
                // cam_list[ui_select].data -= 1;
                // if (cam_list[ui_select].data < 0)
                // {
                //     cam_list[ui_select].data = 0;
                // }
                break;
            }
            break;
        }
        frame_y_trg = ui_select * 20;
        frame_len_trg = 128;
    }
}

void Key_Scan(void)
{
    // 复位4095;右2204;下1909;左1492;上901;按下0;

    // 模式1899
    // 上 1515
    // 菜单 895
    // 下 0

    int v = analogRead(KEY_ADC);
    // u8g2.setCursor(90, 45);
    // u8g2.print(v);
    // printf("%d\n", v);
    // char str[50];
    // sprintf(str, "%d", v);
    // char *newValue = str;
    // pCharacteristic->setValue(newValue);
    // pCharacteristic->notify();

    // while (v >= 0 && v <= 4000)
    // {
    //     v = analogRead(KEY_ADC);
    //     printf("%d\n", v);
    // }

    if (v >= 1700 && v <= 4000) // 按下 切换模式
    {
        if (Runing_Menu.Menu_Item != &Main_Menu || (Runing_Menu.Menu_Item == &Main_Menu && menu_flag != 0 && setting_y != 68))
        {            
            Runing_Menu.Menu_Item = &Main_Menu;
            menu_select = 0;
            menu_flag = 0;
            setting_y_trg = 68;
        }
        else if (Runing_Menu.Menu_Item == &Main_Menu && (Runing_Menu.Menu_Item == &Main_Menu && menu_flag == 0 && setting_y == 68))
        {
            data = 0;
            v = analogRead(KEY_ADC);
            digitalWrite(14, LOW);
            while (v >= 1700 && v <= 4000)
            {
                v = analogRead(KEY_ADC);
            }

            scan_mode++;
            if (scan_mode == 2)
            {
                UART_CAM.begin(9600, SERIAL_8N1, 18, 17);
            }
            if (scan_mode > 2)
            {
                UART_CAM.begin(1200, SERIAL_8E1, 5, -1);
                scan_mode = 0;
            }
        }
    }
    else if (v > 795 && v < 1400) // 上 确认
    {
        data = 0;
        v = analogRead(KEY_ADC);
        while (v > 795 && v < 1400)
        {
            v = analogRead(KEY_ADC);
            key_value = 1;
        }
    }
    else if (v >= 1400 && v < 1700) // 左 加
    {
        data = 0;
        v = analogRead(KEY_ADC);
        while (v >= 1400 && v < 1700)
        {
            v = analogRead(KEY_ADC);
            key_value = 3;
        }
    }
    else if (v == 0) // 右 减
    {
        data = 0;
        v = analogRead(KEY_ADC);
        while (v == 0)
        {
            v = analogRead(KEY_ADC);
            key_value = 2;
        }
    }
    if (digitalRead(TRIG_KEY) == 1)
    {
        data = 0;
        key_time = 0;
        vTaskDelay(10);
        while (digitalRead(TRIG_KEY) == 1)
        {
            vTaskDelay(10);
            key_time++;
        }
        if (oled_list[1].data && data > oled_list[2].data)
        {
            data = 0;
        }
        else if (key_time >= 100)
        {
            GPS_Flag = 1;
        }
        else if (key_time > 10 && key_time < 100)
        {
            switch (scan_mode)
            {
            case 0:
                if (RFID_Flag == 0)
                {
                    IR_Flag = ir_list[2].data;
                    digitalWrite(MCU_BEEP, HIGH);
                    vTaskDelay(300 / portTICK_PERIOD_MS);
                    digitalWrite(MCU_BEEP, LOW);
                }
                break;
            case 1:
                if (RFID_Flag == 0)
                {
                    RFID_Flag = rfid_list[2].data;
                    ;
                }
                break;
            case 2:
                if (CAM_Flag == 0)
                {
                    digitalWrite(MCU_CAM, HIGH);
                    for (int i = ID0(); i < 9 * ID1(); i++)
                    {
                        UART_CAM.write(CAM_Scan_COM[i]);
                    }
                    CAM_Flag = rfid_list[1].data;
                }
                break;
            }
        }
    }
}